From 07861df743f4003bbd69ca3918045c2728ba8135 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 5 Sep 2015 22:33:01 +0000 Subject: [PATCH] Introduce a new `$is_edge` global for the Microsoft Edge browser. The `$is_IE` and `$is_chrome` globals no longer return `true` for Edge, which is expected as Edge is its own browser and should not be treated like IE. While it might be beneficial for Edge to be treated like Chrome on the client side, it benefits nobody for the `$is_chrome` global to return true. See #33193 Props gregrickaby, johnbillion git-svn-id: https://develop.svn.wordpress.org/trunk@33927 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/vars.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/vars.php b/src/wp-includes/vars.php index 828fbbb4ab..d894884c48 100644 --- a/src/wp-includes/vars.php +++ b/src/wp-includes/vars.php @@ -16,7 +16,7 @@ */ global $pagenow, - $is_lynx, $is_gecko, $is_winIE, $is_macIE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $is_IE, + $is_lynx, $is_gecko, $is_winIE, $is_macIE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $is_IE, $is_edge, $is_apache, $is_IIS, $is_iis7, $is_nginx; // On which page are we ? @@ -48,11 +48,13 @@ if ( is_admin() ) { unset($self_matches); // Simple browser detection -$is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = false; +$is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = $is_edge = false; if ( isset($_SERVER['HTTP_USER_AGENT']) ) { if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false ) { $is_lynx = true; + } elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Edge' ) !== false ) { + $is_edge = true; } elseif ( stripos($_SERVER['HTTP_USER_AGENT'], 'chrome') !== false ) { if ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chromeframe' ) !== false ) { $is_admin = is_admin();