JayBizzle / Crawler-Detect

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

Replaced implicit type coercion with strict type check #397

Closed Bilge closed 4 years ago

Bilge commented 4 years ago

By comparing $agent to the empty strict with loose equivalence (==) instead of strict equality (===), this permits matching more than just the empty string, according to the PHP type comparison truth table. Specifically, $agent will also match if it contains the string "0", rather than being empty, which I believe should be regarded as a false positive.

MaxGiting commented 4 years ago

This makes sense to do. Thank you