Author: wikimedia
Description:
MediaWiki 1.17.0
PHP 5.3.8-1~dotdeb.2 (cgi-fcgi)
MySQL 5.1.58-1~dotdeb.1
In /includes/Webstart.php, starting at line 132:
- Initialise output buffering
- Check that there is no previous output or previously set up buffers, because
- that would cause us to potentially mix gzip and non-gzip output, creating a
- big mess.
if ( !defined( 'MW_NO_OUTPUT_BUFFER' ) && ob_get_level() == 0 ) {
require_once( "$IP/includes/OutputHandler.php" ); ob_start( 'wfOutputHandler' );
}
The output handler is not initialized if ob_get_level() != 0. As a consequence, gzip content encoding would not be enabled.
The problem is that ob_get_level() will always return 1 or more if you have output buffering enabled in php.ini (output_buffering is false by default, but PHP suggests a production value of 4096), which means that basically every PHP script starts with ob_start().
One solution to this problem would be to remove the default output buffer early when Mediawiki starts:
while(ob_get_level() > 0){
ob_end_clean();
}
If this is undesired, and if the conditional check in Webstart is not changed, at the least, mediawiki setup should show a warning notice that with the given output_buffering setting, its output handler (i.e. gzip handler) won't be executed.
Version: 1.21.x
Severity: normal