Bug #80606 [NEW]: get_browser returns Chrome instead of Edge on MacOS

From: Date: Thu, 07 Jan 2021 15:56:43 +0000
Subject: Bug #80606 [NEW]: get_browser returns Chrome instead of Edge on MacOS
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231432@lists.php.net to get a copy of this message
From: raul dot tabasso at tabasoft dot it Operating system: MacOS PHP version: 7.4.14 Package: Unknown/Other Function Bug Type: Bug Bug description:get_browser returns Chrome instead of Edge on MacOS Description: ------------ PHP 7.4.12 [GJK_Browscap_Version] Version=6000042 Released=Mon, 07 Dec 2020 08:37:21 +0000 Format=php Type=LITE $_SERVER['HTTP_USER_AGENT'] is: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.66" get_browser() returns Chrome instead of Edge As you can see at the end of HTTP_USER_AGENT there is "... Edg/87.0.664.66", but Chrome 87 is returned. Test script: --------------- $browser = get_browser(); dump ($browser); {#454 ▼ +"browser_name_regex": "~^mozilla/5\.0 \(.*mac os x.*\) applewebkit.* \(.*khtml.*like.*gecko.*\) chrome/87\.0.*safari/.*$~" +"browser_name_pattern": "Mozilla/5.0 (*Mac OS X*) applewebkit* (*khtml*like*gecko*) Chrome/87.0*Safari/*" +"parent": "Chrome 87.0" +"platform": "MacOSX" +"comment": "Chrome 87.0" +"browser": "Chrome" +"version": "87.0" +"device_type": "Desktop" +"ismobiledevice": "" +"istablet": "" } Expected result: ---------------- +"browser": "Edge" -- Edit bug report at https://bugs.php.net/bug.php?id=80606&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80606&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80606&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80606&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80606&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80606&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80606&r=support Expected behavior: https://bugs.php.net/fix.php?id=80606&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80606&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80606&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80606&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80606&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80606&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80606&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80606&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80606&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80606&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80606&r=mysqlcfg

« previous php.bugs (#231432) next »