Skip to content
Browse files

Captcha is html safe for Rails 3

  • Loading branch information...
1 parent 991d089 commit a27b8ae278aa4d587afdf0a46fd0998ec5a9aa0f @sax sax committed with Curtis Miller Apr 18, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/honeypot-captcha/form_tag_helper.rb
View
5 lib/honeypot-captcha/form_tag_helper.rb
@@ -6,10 +6,11 @@ def form_tag_with_honeypot(url_for_options = {}, options = {}, *parameters_for_u
honeypot = options.delete(:honeypot)
html = form_tag_without_honeypot(url_for_options, options, *parameters_for_url, &block)
if honeypot
+ captcha = (Rails.version > "3") ? honey_pot_captcha.html_safe : honey_pot_captcha
if block_given?
- html.insert(html.index('</form>'), honey_pot_captcha)
+ html.insert(html.index('</form>'), captcha)
else
- html += honey_pot_captcha
+ html += captcha
end
end
html

0 comments on commit a27b8ae

Please sign in to comment.
Something went wrong with that request. Please try again.