Page MenuHomePhabricator

Export function doesn't work with apache module mod_gzip
Closed, InvalidPublic

Description

Author: andi

Description:
It looks like the export function doesn't create a right encoding header, so mod_gzip doesn't recognise it as already gziped and gzip it again. The result is a non readable text, because browsers only unzip once.

The produced encoding header looks like this:

Content-Encoding: , gzip

At the moment I only found a workaround by commenting some parts in includes/GlobalFunctions.php:

function wfResetOutputBuffers( $resetGzipEncoding=true ) {

while( $status = ob_get_status() ) {
        if( $status['type'] == 0 /* PHP_OUTPUT_HANDLER_INTERNAL */ ) {
                echo 'status 0';
                // Probably from zlib.output_compression or other
                // PHP-internal setting which can't be removed.
                //
                // Give up, and hope the result doesn't break
                // output behavior.
                break;
        }

/* Commented because of encoding errors

if( !ob_end_clean() ) {
         // Could not remove output buffer handler; abort now
         // to avoid getting in some kind of infinite loop.
         break;
 }

 if( $resetGzipEncoding ) {
         if( $status['name'] == 'ob_gzhandler' ) {
                 // Reset the 'Content-Encoding' field set by this handler
                 // so we can start fresh.
                 header( 'Content-Encoding:' );
         }
 }

*/

}

}


Version: 1.10.x
Severity: normal

Details

Reference
bz9997

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:40 PM
bzimport set Reference to bz9997.
bzimport added a subscriber: Unknown Object (MLST).

andi wrote:

I forgot:
This bug was first in subversion revison 15101 (between Release 1.6 and 1.7) as gzip compression was introduced for exports.

(If possible, please provide Apache version and the configuration of mod_gzip.)

We try to disable buffering (and hence PHP-level compression) on Special:Export so a long export job won't eat too much buffered memory... not 100% sure if that's the best thing though. Looks like there's some weird combination of things on your setup and it's not resetting correctly.

Mass compoment change: <some> -> Export/Import

TTO renamed this task from Export function doesn't work with apache modul mod_gzip to Export function doesn't work with apache module mod_gzip.Jan 3 2016, 3:13 AM
TTO lowered the priority of this task from Low to Lowest.
TTO added a project: TestMe.
TTO set Security to None.
TTO removed a subscriber: wikibugs-l-list.
Dzahn changed the task status from Open to Stalled.May 29 2020, 6:52 AM
Dzahn subscribed.

No follow-up after request for more info in 2007. 13 years ago. Setting to stalled.

TTO added subscribers: brion, TTO.

Based on:

Looks like there's some weird combination of things on your setup and it's not resetting correctly.

...and no confirmations from anyone else in the intervening 13 years, let's just close this bug. If anyone else is somehow still experiencing this ancient issue, please reopen.