diff --git a/composer.json b/composer.json index 421c6db..5254357 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "cbschuld/browser.php", - "description": "A PHP Class to detect a user's Browser", + "description": "A PHP Class to detect a user's Browser. This encapsulation provides a breakdown of the browser and the version of the browser using the browser's user-agent string. This is not a guaranteed solution but provides an overall accurate way to detect what browser a user is using.", "keywords": [ "browser", "user agent", @@ -12,11 +12,11 @@ { "name": "Chris Schuld", "email": "chris@chrisschuld.com", - "homepage": "http://chrisschuld.com" + "homepage": "https://chrisschuld.com" } ], "autoload": { - "classmap": ["lib/Browser.php"] + "classmap": ["src/Browser.php"] }, "require": { "php": ">=7.2" @@ -29,4 +29,4 @@ "require-dev": { "phpunit/phpunit": "^8" } -} \ No newline at end of file +} diff --git a/lib/Browser.php b/src/Browser.php similarity index 99% rename from lib/Browser.php rename to src/Browser.php index d243aab..a089be7 100644 --- a/lib/Browser.php +++ b/src/Browser.php @@ -2,8 +2,8 @@ /** * File: Browser.php * Author: Chris Schuld (http://chrisschuld.com/) - * Last Modified: December 17, 2019 - * @version 1.9.4 + * Last Modified: April 14th, 2020 + * @version 1.9.6 * * Copyright 2019 Chris Schuld * @@ -906,7 +906,7 @@ protected function checkBrowserBrave() */ protected function checkBrowserEdge() { - if ($name = (stripos($this->_agent, 'Edge/') !== false ? 'Edge' : (stripos($this->_agent, 'Edg/') !== false ? 'Edg' : false))) { + if ($name = (stripos($this->_agent, 'Edge/') !== false ? 'Edge' : ((stripos($this->_agent, 'Edg/') !== false || stripos($this->_agent, 'EdgA/') !== false) ? 'Edg' : false))) { $aresult = explode('/', stristr($this->_agent, $name)); if (isset($aresult[1])) { $aversion = explode(' ', $aresult[1]); diff --git a/tests/lists/edge.txt b/tests/lists/edge.txt index 8d1f283..8837e32 100644 --- a/tests/lists/edge.txt +++ b/tests/lists/edge.txt @@ -4,4 +4,6 @@ Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML like Gecko) Chrome (AppleWebKit/537.1; Chrome50.0; Windows NT 6.3) AppleWebKit/537.36 (KHTML like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393 Browser Edge 14.14393 Windows Windows NT Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.9200 Browser Edge 13.9200 Windows Windows NT Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586 Browser Edge 13.10586 Windows Windows NT -Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246 Browser Edge 12.246 Windows Windows NT \ No newline at end of file +Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246 Browser Edge 12.246 Windows Windows NT +Mozilla/5.0 (Linux; Android 8.0.0; moto e5 play Build/OPP27.91-41-1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36 EdgA/42.0.0.2033 Browser Edge 42.0.0.2033 Android Android +Mozilla/5.0 (Linux; Android 10; HRY-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.116 Mobile Safari/537.36 EdgA/45.02.4.4931 Browser Edge 45.02.4.4931 Android Android