Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix false positive of Obigo browser based on pattern in build id
  • Loading branch information
NielsLeenheer committed Jun 10, 2019
1 parent 0efea30 commit f7632b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Analyser/Header/Useragent/Browser.php
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions tests/data/mobile/browser-obigo.yaml
Expand Up @@ -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.