WordPress.org

Make WordPress Core

Changeset 5810


Ignore:
Timestamp:
07/18/2007 09:12:22 PM (13 years ago)
Author:
westi
Message:

Only enable gzip compression if it is not enabled in php.ini. Fixes #4426

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r5801 r5810  
    395395
    396396function gzip_compression() {
    397     if ( !get_option('gzipcompression') ) return false;
    398 
    399     if ( extension_loaded('zlib') ) {
    400         ob_start('ob_gzhandler');
     397    if ( !get_option( 'gzipcompression' ) ) {
     398        return false;
     399    }
     400
     401    if ( ( ini_get( 'zlib.output_compression' ) == 'On' || ini_get( 'zlib.output_compression_level' ) > 0 ) || ini_get( 'output_handler' ) == 'ob_gzhandler' ) {
     402        return false;
     403    }
     404   
     405    if ( extension_loaded( 'zlib' ) ) {
     406        ob_start( 'ob_gzhandler' );
    401407    }
    402408}
Note: See TracChangeset for help on using the changeset viewer.