Skip to content
This repository was archived by the owner on Aug 9, 2019. It is now read-only.

Commit 8cefcf5

Browse files
committed
UserAgentStringParser: Added FlameCore detection ('flamecore-*')
1 parent 6b3205f commit 8cefcf5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/UserAgentStringParser.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ protected function getKnownBrowsers()
171171
'yahoobot',
172172
'yandex\w+',
173173
'baiduspider\w*',
174-
'facebookbot'
174+
'facebookbot',
175+
'flamecore[ -]\w+'
175176
);
176177
}
177178

@@ -314,6 +315,12 @@ protected function filterBots(array $userAgent)
314315
return $userAgent;
315316
}
316317

318+
// FlameCore
319+
if (substr($userAgent['browser_name'], 0, 9) == 'flamecore') {
320+
$userAgent['browser_name'] = 'flamecore-'.substr($userAgent['browser_name'], 10);
321+
return $userAgent;
322+
}
323+
317324
return $userAgent;
318325
}
319326

tests/UserAgentStringParserTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ public function testParserWithBots()
195195
'Feedfetcher-Google; (+http://www.google.com/feedfetcher.html; 2 subscribers; feed-id=6924676383167400434)'
196196
=> array(null, null, null, null),
197197

198+
// FlameCore
199+
'Mozilla/5.0 (compatible; FlameCore Webtools/1.2)'
200+
=> array('flamecore-webtools', '1.2', null, null),
201+
198202
// Speedy Spider
199203
'Speedy Spider (http://www.entireweb.com/about/search_tech/speedy_spider/)'
200204
=> array(null, null, null, null)

0 commit comments

Comments
 (0)