Use stripos() instead of strpos( strtolower() ). Props hakre. see #16920

git-svn-id: https://develop.svn.wordpress.org/trunk@17630 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-04-11 18:55:11 +00:00
parent 412d55a08a
commit 2d5559bb8f
4 changed files with 6 additions and 6 deletions

View File

@ -1615,7 +1615,7 @@ function wp_tiny_mce( $teeny = false, $settings = false ) {
$language = $initArray['language'];
$compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
&& false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip');
&& false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
/**
* Deprecated

View File

@ -134,10 +134,10 @@ header("Cache-Control: public, max-age=$expires_offset");
if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
header('Vary: Accept-Encoding'); // Handle proxies
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
if ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
header('Content-Encoding: deflate');
$out = gzdeflate( $out, 3 );
} elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) {
} elseif ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) {
header('Content-Encoding: gzip');
$out = gzencode( $out, 3 );
}

View File

@ -134,10 +134,10 @@ header("Cache-Control: public, max-age=$expires_offset");
if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
header('Vary: Accept-Encoding'); // Handle proxies
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
if ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
header('Content-Encoding: deflate');
$out = gzdeflate( $out, 3 );
} elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) {
} elseif ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) {
header('Content-Encoding: gzip');
$out = gzencode( $out, 3 );
}

View File

@ -27,7 +27,7 @@ header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GM
header("Cache-Control: public, max-age=$expires_offset");
if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
&& false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
&& false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
header('Content-Encoding: gzip');
echo $file;