Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty user agent #75

Closed
timersys opened this issue Apr 4, 2016 · 1 comment
Closed

Empty user agent #75

timersys opened this issue Apr 4, 2016 · 1 comment

Comments

@timersys
Copy link
Contributor

timersys commented Apr 4, 2016

If its empty user agent is treated as a crawler? Can we add a simple setting variable to do that? That all empty UA should be treated as crawler

@JayBizzle
Copy link
Owner

Hi,

Thanks for the suggestion. I can understand why you may want this adding, but in my opinion, keeping CrawlerDetect matter of fact is the way go i.e. it is a bot, or not.

In my opinion, an empty user agent is just a guess, and i dont think this library should guess. I know your suggestion will make this user configurable, but you could just as easliy do this

$crawlerdetect = new CrawlerDetect();

$useragent = $_SERVER['HTTP_USER_AGENT'];

if(empty($useragent) || $crawlerdetect->isCrawler($useragent) {
    // it is a bot
}

Unless you can convince me other wise 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants