Support output_handler = ob_gzhandler in script/style compressor, props DD32, fixes #9000

git-svn-id: https://develop.svn.wordpress.org/trunk@10466 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-01-30 13:45:05 +00:00
parent 55c270d136
commit 6e7efb1d97
2 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@ function get_file($path) {
while ( @ob_end_clean() ); while ( @ob_end_clean() );
if ( isset($_GET['test']) && 1 == $_GET['test'] ) { if ( isset($_GET['test']) && 1 == $_GET['test'] ) {
if ( ini_get('zlib.output_compression') ) if ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') )
exit(''); exit('');
$out = 'var wpCompressionTest = 1;'; $out = 'var wpCompressionTest = 1;';
@ -143,7 +143,7 @@ header('Content-Type: application/x-javascript; charset=UTF-8');
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT'); header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
header("Cache-Control: public, max-age=$expires_offset"); header("Cache-Control: public, max-age=$expires_offset");
if ( $compress && ! ini_get('zlib.output_compression') ) { if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') ) {
header('Vary: Accept-Encoding'); // Handle proxies header('Vary: Accept-Encoding'); // Handle proxies
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
header('Content-Encoding: deflate'); header('Content-Encoding: deflate');

View File

@ -127,7 +127,7 @@ header('Content-Type: text/css');
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT'); header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
header("Cache-Control: public, max-age=$expires_offset"); header("Cache-Control: public, max-age=$expires_offset");
if ( $compress && ! ini_get('zlib.output_compression') ) { if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') ) {
header('Vary: Accept-Encoding'); // Handle proxies header('Vary: Accept-Encoding'); // Handle proxies
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
header('Content-Encoding: deflate'); header('Content-Encoding: deflate');