Make WordPress Core


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.