JayBizzle / Crawler-Detect

🕷 CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent
https://crawlerdetect.io
MIT License
2.01k stars 258 forks source link

Googlebot regex collision #135

Closed amochohan closed 8 years ago

amochohan commented 8 years ago

When I add the following user agent to the devices.txt test file:

Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

The tests fail. However, when I add Googlebot to the Crawlers.php file, PHPUnit fails because there is a regex collision.

JayBizzle commented 8 years ago

Hi,

Bot user agents should be added to crawlers.txt not devices.txt

When you add Googlebot to the Crawlers.php array, the tests will fail because Googlebot is already detected by our generic regex which you can see here

Thanks