[TYPO3-core] FYI72: #9947: gzip compression does not work in BE at all

Steffen Kamper info at sk-typo3.de
Mon Dec 15 13:34:19 CET 2008


Hi Dmitry,

Dmitry Dulepov schrieb:
> Hi!
> 
> Steffen Kamper wrote:
>> no objection, but in the other thread in BT (#3071) you mentioned that
>> this will solve the problem. Can you explain how this is related to
>> empty lines in php-files?
> 
> Empty lines in the ext_tables.php/ext_localconf.php/localconf.php or any files included by the previously mentioned files will appear in the web server output. In AJAX calls they will create invalid XML because no space can appear before the XML declaration. I.e. this is not valid:
> 
> ===========
> 
> <?xml encoding="utf-8"?>
> <xml></xml>
> ===========
> 
> This is the only valid form:
> ===========
> <?xml encoding="utf-8"?>
> <xml></xml>
> ===========
> 
> These empty lines cause JavaScript error while parsing click menu xml. The error is hidden by a catch block, so there is no error in the browser, user just see nothing after click. (It is good to hide such errors, so no problem with catch) I encountered this error first time a couple of months ago on one of sites made by Netcreators, where a 3rd party extension had extra lines in ext_table.php, so I knew the cause when this problem hit me again :) I stumbled upon it at my localhost today morning and went to BT to check if there is a bug report about it. While trying to fix it, I accidentally found that BE compression does not work. So I decided to kill both bugs with one shot. This is the story...
> 
> The same empty lines and spaces will break not only AJAX but also zlib compresssion. In the patch I use ob_start/ob_clean to prevent any problems with compressed output. ob_start() accumulates any empty lines or any other output from the above mentioned files, which must not happen according to our conventions. ob_clean() discards it completely. So both compression and ajax problems are solved with one hit.
> 

great :-) thx for your explanation and of course for your fix!

vg Steffen


More information about the TYPO3-team-core mailing list