Make WordPress Core

Changeset 13132


Ignore:
Timestamp:
02/14/2010 02:27:19 AM (15 years ago)
Author:
nacin
Message:

Use stripos() instead of strpos() with strtolower(). For PHP < 5 we have stripos() in compat.php. Fixes #11176

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r13088 r13132  
    9494            if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
    9595                die('-1');
    96             if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
     96            if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
    9797                header('Content-Encoding: deflate');
    9898                $out = gzdeflate( $test_str, 1 );
    99             } elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) {
     99            } elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) {
    100100                header('Content-Encoding: gzip');
    101101                $out = gzencode( $test_str, 1 );
  • trunk/wp-admin/includes/class-wp-filesystem-ftpext.php

    r12999 r13132  
    259259        static $is_windows;
    260260        if ( is_null($is_windows) )
    261             $is_windows = strpos( strtolower( ftp_systype($this->link) ), 'win') !== false;
     261            $is_windows = stripos( ftp_systype($this->link), 'win') !== false;
    262262
    263263        if ( $is_windows && preg_match('/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/', $line, $lucifer) ) {
  • trunk/wp-admin/includes/media.php

    r13106 r13132  
    13831383    // If Mac and mod_security, no Flash. :(
    13841384    $flash = true;
    1385     if ( false !== strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mac') && apache_mod_loaded('mod_security') )
     1385    if ( false !== stripos($_SERVER['HTTP_USER_AGENT'], 'mac') && apache_mod_loaded('mod_security') )
    13861386        $flash = false;
    13871387
  • trunk/wp-includes/general-template.php

    r13113 r13132  
    11471147    }
    11481148
    1149     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false)
     1149    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'camino') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false)
    11501150        $ak_title_separator = "\n";
    11511151    else
  • trunk/wp-includes/vars.php

    r12284 r13132  
    4141    if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false ) {
    4242        $is_lynx = true;
    43     } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) {
     43    } elseif ( stripos($_SERVER['HTTP_USER_AGENT'], 'chrome') !== false ) {
    4444        $is_chrome = true;
    45     } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false ) {
     45    } elseif ( stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false ) {
    4646        $is_safari = true;
    4747    } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false ) {
     
    5858}
    5959
    60 if ( $is_safari && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') !== false )
     60if ( $is_safari && stripos($_SERVER['HTTP_USER_AGENT'], 'mobile') !== false )
    6161    $is_iphone = true;
    6262
Note: See TracChangeset for help on using the changeset viewer.