Skip to content

Commit 9d07d64

Browse files
authored
Merge pull request #93 from cbschuld/android_edge
Android Edge Addition & Misc
2 parents c880d1b + 1679cb4 commit 9d07d64

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cbschuld/browser.php",
3-
"description": "A PHP Class to detect a user's Browser",
3+
"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.",
44
"keywords": [
55
"browser",
66
"user agent",
@@ -12,11 +12,11 @@
1212
{
1313
"name": "Chris Schuld",
1414
"email": "[email protected]",
15-
"homepage": "http://chrisschuld.com"
15+
"homepage": "https://chrisschuld.com"
1616
}
1717
],
1818
"autoload": {
19-
"classmap": ["lib/Browser.php"]
19+
"classmap": ["src/Browser.php"]
2020
},
2121
"require": {
2222
"php": ">=7.2"
@@ -29,4 +29,4 @@
2929
"require-dev": {
3030
"phpunit/phpunit": "^8"
3131
}
32-
}
32+
}

lib/Browser.php src/Browser.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/**
33
* File: Browser.php
44
* Author: Chris Schuld (http://chrisschuld.com/)
5-
* Last Modified: December 17, 2019
6-
* @version 1.9.4
5+
* Last Modified: April 14th, 2020
6+
* @version 1.9.6
77
*
88
* Copyright 2019 Chris Schuld
99
*
@@ -906,7 +906,7 @@ protected function checkBrowserBrave()
906906
*/
907907
protected function checkBrowserEdge()
908908
{
909-
if ($name = (stripos($this->_agent, 'Edge/') !== false ? 'Edge' : (stripos($this->_agent, 'Edg/') !== false ? 'Edg' : false))) {
909+
if ($name = (stripos($this->_agent, 'Edge/') !== false ? 'Edge' : ((stripos($this->_agent, 'Edg/') !== false || stripos($this->_agent, 'EdgA/') !== false) ? 'Edg' : false))) {
910910
$aresult = explode('/', stristr($this->_agent, $name));
911911
if (isset($aresult[1])) {
912912
$aversion = explode(' ', $aresult[1]);

tests/lists/edge.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML like Gecko)
44
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
55
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
66
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
7-
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
7+
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
8+
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
9+
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 commit comments

Comments
 (0)