Project

General

Profile

Defect #3480 » allow_empty_user_agent.patch

Jérémy Lal, 2010-06-18 00:36

View differences:

lib/bots_filter.rb.new 2010-06-18 00:37:16.300475863 +0200
41 41
  BOTS_USER_AGENT_RE = Regexp.new("(#{BOTS_USER_AGENT.collect {|a| Regexp.escape(a)}.join('|')})", Regexp::IGNORECASE)
42 42
  
43 43
  def bot_request?
44
    request.user_agent.match(BOTS_USER_AGENT_RE)
44
    if request.user_agent.blank?
45
      return false
46
    end
47
    request.user_agent.match(BOTS_USER_AGENT_RE)    
45 48
  end
46 49
end
47 50

  
(2-2/2)