FIX: cubot android devices were detected as crawlers

This commit is contained in:
Sam
2018-06-21 10:56:46 +10:00
parent 50d11fd582
commit f66efc601d
3 changed files with 53 additions and 31 deletions

View File

@ -22,7 +22,12 @@ module CrawlerDetection
if user_agent.match?(possibly_real)
known_bots = (@matchers[SiteSetting.crawler_user_agents] ||= to_matcher(SiteSetting.crawler_user_agents))
user_agent.match?(known_bots)
if user_agent.match?(known_bots)
bypass = (@matchers[SiteSetting.crawler_check_bypass_agents] ||= to_matcher(SiteSetting.crawler_check_bypass_agents))
!user_agent.match?(bypass)
else
false
end
else
true
end