WordPress.org

Make WordPress Core

Ticket #15319: browser_v2.patch

File browser_v2.patch, 1.2 KB (added by pross, 8 years ago)
  • wp-includes/vars.php

     
    5252                $is_safari = true;
    5353        } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false ) {
    5454                $is_gecko = true;
    55         } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Win') !== false ) {
    56                 $is_winIE = true;
    57         } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false ) {
    58                 $is_macIE = true;
     55        } elseif ( ( $msie = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) && strpos($_SERVER['HTTP_USER_AGENT'], 'Win') !== false ) {
     56                $is_IE = substr($_SERVER['HTTP_USER_AGENT'], $msie + 5, 3);
    5957        } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false ) {
    6058                $is_opera = true;
    61         } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false ) {
    62                 $is_NS4 = true;
    6359        }
    6460}
    6561
    6662if ( $is_safari && stripos($_SERVER['HTTP_USER_AGENT'], 'mobile') !== false )
    6763        $is_iphone = true;
    6864
    69 $is_IE = ( $is_macIE || $is_winIE );
    70 
    7165// Server detection
    7266
    7367/**