vipx-bot-detect icon indicating copy to clipboard operation
vipx-bot-detect copied to clipboard

Mozilla 5.0 Custom is detected as Custo bot

Open smilesrg opened this issue 10 years ago • 2 comments

I noticed that user-agent string Mozilla 5.0 Custom is detected as Custo bot. Maybe regexp matcher should be changed somehow to detect bots more precisely?

smilesrg avatar Jun 10 '15 15:06 smilesrg

Good catch. I think the regular expression for the agent string should only match words, alphabetical strings which are devided to other strings by some kind of non alphabetical letters.

https://github.com/lennerd/vipx-bot-detect/blob/master/Metadata/Metadata.php#L117

lennerd avatar Jun 10 '15 19:06 lennerd

Boundaries should be included in the user agent string - usually they don't change easily, for example a / or a space before and/or after a name. In the case of Custo, I think the user agent could be changed to match "Custo" exactly, not "Custo" in any part of the user agent, by defining "agent_match: exact" for the bot.

All the matching strings should be as long as possible, or exact matches for short strings, otherwise they could be some kind of collision in the future. A requirement could also be that the user agent starts with the given string - i.e. an agent_match: beginning option or something like that, so only a user agent with "Custo" at the beginning is a match.

iquito avatar Sep 16 '15 18:09 iquito