Skip to content

Commit

Permalink
Merge pull request #93 from cbschuld/android_edge
Browse files Browse the repository at this point in the history
Android Edge Addition & Misc
  • Loading branch information
cbschuld authored Apr 14, 2020
2 parents c880d1b + 1679cb4 commit 9d07d64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -12,11 +12,11 @@
{
"name": "Chris Schuld",
"email": "[email protected]",
"homepage": "http://chrisschuld.com"
"homepage": "https://chrisschuld.com"
}
],
"autoload": {
"classmap": ["lib/Browser.php"]
"classmap": ["src/Browser.php"]
},
"require": {
"php": ">=7.2"
Expand All @@ -29,4 +29,4 @@
"require-dev": {
"phpunit/phpunit": "^8"
}
}
}
6 changes: 3 additions & 3 deletions lib/Browser.php → src/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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]);
Expand Down
4 changes: 3 additions & 1 deletion tests/lists/edge.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 9d07d64

Please sign in to comment.