From d87e74123fc931725868a9593bcc306e1d18ce38 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Tue, 23 Jun 2015 22:32:45 +0200 Subject: [PATCH] add mobile Edge support --- include/classes/useragent.php-class | 4 ++++ testbed/ua_list_raw.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/include/classes/useragent.php-class b/include/classes/useragent.php-class index 22dc491..380745f 100755 --- a/include/classes/useragent.php-class +++ b/include/classes/useragent.php-class @@ -363,6 +363,7 @@ class userAgent { $this->brand = 'Edge'; $this->version = $regs[1]; $this->bot = false; + $this->mobile = preg_match('| Mobile |', $this->uastring); } elseif (preg_match('|Chromium/([0-9a-zA-Z\.+]+)|', $this->uastring, $regs)) { $this->brand = 'Chromium'; @@ -1244,6 +1245,9 @@ class userAgent { if (preg_match('#Mozilla/5.0 \(([^;]+); (WOW64|Win64); ([^\);]+)\)#', $this->uastring, $regs)) { $this->uadata['os'] = $regs[1].' ('.$regs[2].')'; } + elseif (preg_match('#Mozilla/5.0 \(([^;]+Phone[^;]+); [^\)]+\)#i', $this->uastring, $regs)) { + $this->uadata['os'] = $regs[1]; + } } elseif ($this->hasEngine('trident') || $this->hasEngine('tasman')) { if (preg_match('/Mozilla\/[^\(]+ \((IE [^;]+[^\)]*; )?((?:Mac|Win)[^;]+); ?(Win64|WOW64); ?Trident\/([^;\)]+);/i', $this->uastring, $regs)) { diff --git a/testbed/ua_list_raw.txt b/testbed/ua_list_raw.txt index 4ba4102..1bbb40c 100755 --- a/testbed/ua_list_raw.txt +++ b/testbed/ua_list_raw.txt @@ -117,6 +117,7 @@ Mozilla/5.0 (X11; U; Linux i686) Gecko/20040319 Galeon/1.3.7 Mozilla/5.0 Galeon/1.2.7 (X11; Linux i686; U;) Gecko/20021204 Galeon/1.3.7 (IE4 compatible; I; Windows XP) Galeon/1.3.7 Debian/1.3.7.20030803-1 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0 +Mozilla/5.0 (Windows Phone 10; Android 4.2.1; Microsoft; NOKIA) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Mobile Safari/537.36 Edge/12.0 Microsoft Internet Explorer/4.0b1 (Windows 95) Mozilla/1.22 (compatible; MSIE 1.5; Windows NT) Mozilla/2.0 (compatible; MSIE 3.01; Windows 95) -- 2.35.3