Skip to content
Permalink
Browse files

Fix false positive of Obigo browser based on pattern in build id

  • Loading branch information...
NielsLeenheer committed Jun 10, 2019
1 parent 0efea30 commit f7632b3fa47db56ccfdb64bff0d480fa44ee0ecc
Showing with 5 additions and 1 deletion.
  1. +1 −1 src/Analyser/Header/Useragent/Browser.php
  2. +4 −0 tests/data/mobile/browser-obigo.yaml
@@ -1418,7 +1418,7 @@ private function detectObigo($ua)
}
}
if (preg_match('/(Q)0?([0-9][A-Z])/u', $ua, $match)) {
if (preg_match('/[^A-Z](Q)0?([0-9][A-Z])/u', $ua, $match)) {
$this->data->browser->name = 'Obigo ' . $match[1];
$this->data->browser->version = new Version($processObigoVersion($match[2]));
$this->data->browser->type = Constants\BrowserType::BROWSER;
@@ -186,3 +186,7 @@
headers: 'User-Agent: LG-ME850c MIC/1.1.14 MIDP-2.0/CLDC-1.1'
readable: 'Obigo 1.1 on a LG ME850c'
result: { browser: { name: Obigo, version: '1.1', type: browser }, device: { type: mobile, subtype: feature, manufacturer: LG, model: ME850c } }
-
headers: 'User-Agent: Mozilla/5.0 (Linux; Android 9; Nokia 1 Build/PQ2A.190405.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.158 Mobile Safari/537.36'
readable: 'Chromium WebView 66 on a Nokia 1 running Android 9'
result: { browser: { using: { name: 'Chromium WebView', version: '66' } }, engine: { name: Blink }, os: { name: Android, version: '9' }, device: { type: mobile, subtype: smart, manufacturer: Nokia, model: '1' } }

0 comments on commit f7632b3

Please sign in to comment.
You can’t perform that action at this time.