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

Built from https://develop.svn.wordpress.org/trunk@33927


git-svn-id: http://core.svn.wordpress.org/trunk@33896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2015-09-05 22:33:23 +00:00
parent 15b487b097
commit f482b909e6
2 changed files with 5 additions and 3 deletions

View File

@ -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();

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-33926';
$wp_version = '4.4-alpha-33927';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.