diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-03-31 15:02:46 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-03-31 15:02:46 +0100 |
commit | 6fbaed8b841d081681fe970abab38b648fed5253 (patch) | |
tree | 40a90f460bd7f9dcce59d55aab89a783bb610439 /app/controllers/help_controller.rb | |
parent | 051d5062dfb4a6f60b6c4fec5058039661afadc7 (diff) | |
parent | 5d6d21f690e283682b9be74a8f00c501b148856f (diff) |
Merge branch 'issues/1389-contact-form-honeypot' into rails-3-develop
Diffstat (limited to 'app/controllers/help_controller.rb')
-rw-r--r-- | app/controllers/help_controller.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 9959df6d8..9033198a0 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -9,6 +9,7 @@ class HelpController < ApplicationController # we don't even have a control subroutine for most help pages, just see their templates before_filter :long_cache + before_filter :catch_spam, :only => [:contact] def unhappy @info_request = nil @@ -69,4 +70,12 @@ class HelpController < ApplicationController end + private + + def catch_spam + if request.post? && !params[:contact][:comment].empty? + redirect_to frontpage_url + end + end + end |