Last modified: 2012-11-03 08:39:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T11997, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9997 - Export function doesn't work with apache modul mod_gzip
Export function doesn't work with apache modul mod_gzip
Status: NEW
Product: MediaWiki
Classification: Unclassified
Export/Import (Other open bugs)
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-05-21 22:06 UTC by Andreas Hubel
Modified: 2012-11-03 08:39 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Andreas Hubel 2007-05-21 22:06:26 UTC
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.
/* 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.

                if( $resetGzipEncoding ) {
                        if( $status['name'] == 'ob_gzhandler' ) {
                                // Reset the 'Content-Encoding' field set by this handler
                                // so we can start fresh.
                                header( 'Content-Encoding:' );
Comment 1 Andreas Hubel 2007-05-21 22:09:56 UTC
I forgot: 
This bug was first in subversion revison 15101 (between Release 1.6 and 1.7) as gzip compression was introduced for exports.
Comment 2 Brion Vibber 2007-05-22 14:07:27 UTC
(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.
Comment 3 Siebrand Mazeland 2008-08-18 18:47:36 UTC
Mass compoment change: <some> -> Export/Import

Note You need to log in before you can comment on or make changes to this bug.