WordPress.org

Make WordPress Core

Ticket #20014: 20014-vars.php.patch

File 20014-vars.php.patch, 935 bytes (added by azaozz, 6 years ago)
  • wp-includes/vars.php

     
    7171        } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false ) {
    7272                $is_NS4 = true;
    7373        }
     74       
     75        // Set to true for mobile devices (smart phones, tablets, etc.)
     76        if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false // most WebKit mobile builds (all iPhone, iPad, etc.)
     77                || strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false
     78                || strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') !== false
     79                || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false )
     80                        $is_iphone = true;
    7481}
    7582
    76 if ( $is_safari && stripos($_SERVER['HTTP_USER_AGENT'], 'mobile') !== false )
    77         $is_iphone = true;
    7883
     84
    7985$is_IE = ( $is_macIE || $is_winIE );
    8086
    8187// Server detection