Defect #3480 » bot_filter.patch
| lib\bots_filter_new.rb Wed Jun 10 23:43:27 2009 | ||
|---|---|---|
|
BOTS_USER_AGENT_RE = Regexp.new("(#{BOTS_USER_AGENT.collect {|a| Regexp.escape(a)}.join('|')})", Regexp::IGNORECASE)
|
||
|
|
||
|
def bot_request?
|
||
|
request.user_agent.match(BOTS_USER_AGENT_RE)
|
||
|
if request.user_agent.nil?
|
||
|
return true
|
||
|
end
|
||
|
return request.user_agent.match(BOTS_USER_AGENT_RE)
|
||
|
end
|
||
|
end
|
||
|
|
||