Skip to content
This repository was archived by the owner on Feb 17, 2024. It is now read-only.

Commit a2eece1

Browse files
committed
Small browser detection update.
1 parent 2a802a6 commit a2eece1

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

browser_detection.inc

+15-4
Original file line numberDiff line numberDiff line change
@@ -390,14 +390,15 @@ function browser_detection( $which_test, $test_excludes='', $external_ua_string=
390390
array( 'adsbot-google', false, 'google-ads', 'bot' ),
391391
array( 'applebot', false, 'applebot', 'bot' ),
392392
array( 'baidu', false, 'baidu', 'bot' ),
393-
array( 'bingbot', false, 'bing', 'bot' ),
394-
array( 'bingpreview', false, 'bing', 'bot' ),
393+
array( 'bing', false, 'bing', 'bot' ),
394+
array( 'daum', false, 'daum', 'bot' ),
395395
array( 'ips-agent', false, 'ips-agent', 'bot' ),
396396
array( 'msnbot', false, 'msn', 'bot' ),
397397
array( 'exabot', false, 'exabot', 'bot' ),
398398
array( 'googlebot', false, 'google', 'bot' ),
399399
array( 'google web preview', false, 'googlewp', 'bot' ),
400400
array( 'surdotlybot', false, 'surdotlybot', 'bot' ),
401+
array( 'surveybot', false, 'surveybot', 'bot' ),
401402
array( 'yandex', false, 'yandex', 'bot' ),
402403

403404
/** then start on ideally 'real' browsers **/
@@ -440,9 +441,14 @@ function browser_detection( $which_test, $test_excludes='', $external_ua_string=
440441
441442
1: misc catchalls - use first to avoid extra looping. See comment footer for examples.
442443
**/
444+
array( 'aggregat', false, 'misc-bot', 'bot' ),
443445
array( ' bot', false, 'misc-bot', 'bot' ),
446+
array( 'bot ', false, 'misc-bot', 'bot' ),
444447
array( '-bot', false, 'misc-bot', 'bot' ),
445448
array( '_bot', false, 'misc-bot', 'bot' ),
449+
array( 'bot/', false, 'misc-bot', 'bot' ),
450+
array( 'bot:', false, 'misc-bot', 'bot' ),
451+
array( 'check', false, 'misc-bot', 'bot' ),
446452
array( 'crawl', false, 'misc-bot', 'bot' ),
447453
array( 'download', false, 'misc-dow', 'dow' ),
448454
array( 'fetch', false, 'misc-dow', 'dow' ),
@@ -511,6 +517,7 @@ function browser_detection( $which_test, $test_excludes='', $external_ua_string=
511517
array( 'grammarly', false, 'grammarly', 'bot' ),
512518
array( 'guardcrwlr', false, 'guardcrwlr', 'bot' ),
513519
array( 'headmasterseo', false, 'headmasterseo', 'bot' ),
520+
array( 'heritrix', false, 'heritrix', 'bot' ),
514521
array( 'hosttracker', false, 'hosttracker', 'bot' ),/** uptime checker, host-tracker.com **/
515522
array( 'hubspot', false, 'hubspot', 'bot' ),/** HubSpot Links Crawler **/
516523
array( 'hybridbot', false, 'hybridbot', 'bot' ),/** russian ad bot: hybrid.ru/about **/
@@ -529,6 +536,7 @@ function browser_detection( $which_test, $test_excludes='', $external_ua_string=
529536
array( 'objectssearch', false, 'objectsearch', 'bot' ),/** open source search engine **/
530537
array( 'omgilibot', false, 'omgilibot', 'bot' ),
531538
array( 'openbot', false, 'openbot', 'bot' ),/** openbot, from taiwan **/
539+
array( 'orangebot', false, 'orangebot', 'bot' ),
532540
array( 'paperlibot', false, 'paperlibot', 'bot' ),/** http://support.paper.li **/
533541
array( 'pingdom', false, 'pingdom', 'bot' ),
534542
array( 'pinterest', false, 'pinterest', 'bot' ),/** www.pinterest.com **/
@@ -542,6 +550,7 @@ function browser_detection( $which_test, $test_excludes='', $external_ua_string=
542550
array( 'safednsbot', false, 'safednsbot', 'bot' ),/** safednsbot **/
543551
array( 'salesintelligent', false, 'salesintelligent', 'bot' ),
544552
array( 'scooter', false, 'scooter', 'bot' ),/** altavista **/
553+
array( 'scoutjet', false, 'scoutjet', 'bot' ),
545554
array( 'scrapy', false, 'scrapy', 'bot' ),
546555
array( 'searchie', false, 'searchiet', 'bot' ),/** ua: Searchie/1.0 **/
547556
array( 'semrushbot', false, 'semrushbot', 'bot' ),/** semrush.com/bot.html **/
@@ -554,7 +563,6 @@ function browser_detection( $which_test, $test_excludes='', $external_ua_string=
554563
array( 'socialrankiobot', false, 'socialrankiobot', 'bot' ),/** http://socialrank.io/about **/
555564
array( 'sohu-search', false, 'sohu', 'bot' ),/** chinese media company, search component **/
556565
array( 'spbot', false, 'spbot', 'bot' ),
557-
array( 'surveybot', false, 'surveybot', 'bot' ),
558566
array( 'telegrambot', false, 'telegrambot', 'bot' ),/** TelegramBot (like TwitterBot) **/
559567
array( 'twitterbot', false, 'twitterbot', 'bot' ),/** Twitterbot/1.0 **/
560568
array( 'vbseo', false, 'vbseo', 'bot' ),
@@ -1623,7 +1631,7 @@ function get_mobile_data( $pv_browser_user_agent )
16231631
using regex (?!mobile) did not work in my tests, not sure why.
16241632
**/
16251633
$pattern = '/android[[:space:]]*[4-9]/';
1626-
if( preg_match( $pattern, $pv_browser_user_agent ) && !stristr($pv_browser_user_agent, 'mobile') ) {
1634+
if( preg_match( $pattern, $pv_browser_user_agent ) && !strstr($pv_browser_user_agent, 'mobile') ) {
16271635
$mobile_tablet = 'android tablet';
16281636
}
16291637
else {
@@ -1791,6 +1799,9 @@ Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:14.0; ips-agent) Gecko/20100101 Firefox
17911799
SurdotlyBot:
17921800
Mozilla/5.0 (compatible; SurdotlyBot/1.0; +http://sur.ly/bot.html; Linux; Android 4; iPhone; CPU iPhone OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A523 Safari/8536.25
17931801
--------------------------------------------------------
1802+
SurveyBot:
1803+
Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.9.0.13) Gecko/2009073022 Firefox/3.5.2 (.NET CLR 3.5.30729) SurveyBot/2.3 (DomainTools)
1804+
--------------------------------------------------------
17941805
Yandex bots:
17951806
https://yandex.com/support/webmaster/robot-workings/check-yandex-robots.xml
17961807
------------

0 commit comments

Comments
 (0)