From 64552a67eedcf20c5175051ae4a542eb38b6cf3c Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 11 Apr 2011 18:55:11 +0000 Subject: [PATCH] Use stripos() instead of strpos( strtolower() ). Props hakre. see #16920 git-svn-id: http://svn.automattic.com/wordpress/trunk@17630 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 2 +- wp-admin/load-scripts.php | 4 ++-- wp-admin/load-styles.php | 4 ++-- wp-includes/js/tinymce/wp-tinymce.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index c5a32b97a..e12e6260f 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -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 diff --git a/wp-admin/load-scripts.php b/wp-admin/load-scripts.php index b572d0cc2..95a0c0ccf 100644 --- a/wp-admin/load-scripts.php +++ b/wp-admin/load-scripts.php @@ -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 ); } diff --git a/wp-admin/load-styles.php b/wp-admin/load-styles.php index e9673e26b..be781e299 100644 --- a/wp-admin/load-styles.php +++ b/wp-admin/load-styles.php @@ -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 ); } diff --git a/wp-includes/js/tinymce/wp-tinymce.php b/wp-includes/js/tinymce/wp-tinymce.php index 02be3f20f..449f0e25f 100644 --- a/wp-includes/js/tinymce/wp-tinymce.php +++ b/wp-includes/js/tinymce/wp-tinymce.php @@ -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;