Fixed bug #9947: gzip compression does not work in BE at all
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 18 Dec 2008 13:13:13 +0000 (13:13 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 18 Dec 2008 13:13:13 +0000 (13:13 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2@4564 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/init.php

index ba3c55c..1878a46 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-18  Dmitry Dulepov  <dmitry@typo3.org>
+
+       * Fixed bug #9947: gzip compression does not work in BE at all
+
 2008-12-18  Ernesto Baschny  <ernst@cron-it.de>
 
        * Fixed bug #9511: getHtmlTemplate should use resolveBackPath. Fixes bug for extension BE modules using templates in certain environments (symlinked typo3/ dir) (thanks to Steffen Gebert)
index 37ac889..cb54dea 100755 (executable)
@@ -68,6 +68,11 @@ if (version_compare(phpversion(), '5.1', '<'))       die ('TYPO3 requires PHP 5.1.0 or
 // *******************************
 error_reporting (E_ALL ^ E_NOTICE);
 
+// *******************************
+// Prevent any unwanted output that may corrupt AJAX/compression. Note: this does
+// not interfeer with "die()" or "echo"+"exit()" messages!
+// *******************************
+ob_start();
 
 // *******************************
 // Define constants
@@ -376,8 +381,9 @@ if (defined('TYPO3_cliMode') && TYPO3_cliMode)      {
 // ****************
 // compression
 // ****************
-if ($TYPO3_CONF_VARS['BE']['compressionLevel'])        {
-       ob_start();
-       require_once (PATH_t3lib.'class.gzip_encode.php');
+ob_clean();
+if (extension_loaded('zlib') && $TYPO3_CONF_VARS['BE']['compressionLevel'])    {
+       @ini_set('zlib.output_compression_level', $TYPO3_CONF_VARS['BE']['compressionLevel']);
+       ob_start('ob_gzhandler');
 }
 ?>