General: Update Opera browser sniff follow UA string changes.

Since switching to the Blink engine, Opera browsers contain both the strings `Chrome` and `OPR\`. This change relocates the Opera test to take place before the Chrome test to ensure the correct browser is detected.

Props brasofilo, desrosj, costdev, mukesh27, swissspidy.
Fixes #46132.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson 2023-07-13 00:58:25 +00:00
parent 94f92497ce
commit 1211214fd8
2 changed files with 3 additions and 3 deletions

View File

@ -69,6 +69,8 @@ if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
$is_lynx = true;
} elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Edg' ) ) {
$is_edge = true;
} elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Opera' ) || str_contains( $_SERVER['HTTP_USER_AGENT'], 'OPR/' ) ) {
$is_opera = true;
} elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chrome' ) !== false ) {
if ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chromeframe' ) !== false ) {
$is_admin = is_admin();
@ -95,8 +97,6 @@ if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
$is_macIE = true;
} elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Gecko' ) ) {
$is_gecko = true;
} elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Opera' ) ) {
$is_opera = true;
} elseif ( str_contains( $_SERVER['HTTP_USER_AGENT'], 'Nav' ) && str_contains( $_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.' ) ) {
$is_NS4 = true;
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-beta4-56223';
$wp_version = '6.3-beta4-56224';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.