diff --git a/app/controllers/public/content_viewer_controller.rb b/app/controllers/public/content_viewer_controller.rb index d8eb96e..3b89b3b 100644 --- a/app/controllers/public/content_viewer_controller.rb +++ b/app/controllers/public/content_viewer_controller.rb @@ -159,10 +159,12 @@ class ContentViewerController < ApplicationController helper_method :pass_without_comment_captcha? def user_is_a_bot? - request.env["HTTP_USER_AGENT"].match(/bot/) || - request.env["HTTP_USER_AGENT"].match(/spider/) || - request.env["HTTP_USER_AGENT"].match(/crawler/) || - request.env["HTTP_USER_AGENT"].match(/\(.*https?:\/\/.*\)/) + user_agent= request.env["HTTP_USER_AGENT"] + user_agent.blank? || + user_agent.match(/bot/) || + user_agent.match(/spider/) || + user_agent.match(/crawler/) || + user_agent.match(/\(.*https?:\/\/.*\)/) end end -- libgit2 0.21.2