General: Improve MS Edge user-agent sniff.

Update the `$is_edge` global to be `true` if the browser's user-agent contains `Edg` rather than `Edge`. Microsoft have dropped an E from the UA string.

Refer to [https://docs.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-guidance#identifiers-for-microsoft-edge-on-various-platforms Microsoft's documentation on detecting edge].

Props costdev, abdullahramzan, mukesh27, Boniu91.
Fixes #55297.



git-svn-id: https://develop.svn.wordpress.org/trunk@52825 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Wilson 2022-03-07 02:36:01 +00:00
parent 34d98887a2
commit 177c315c12

View File

@ -65,7 +65,7 @@ $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 ) {
} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Edg' ) !== false ) {
$is_edge = true;
} elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chrome' ) !== false ) {
if ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chromeframe' ) !== false ) {