Skip to content

Commit

Permalink
Captcha is html safe for Rails 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sax authored and Curtis Miller committed Apr 20, 2010
1 parent 991d089 commit a27b8ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/honeypot-captcha/form_tag_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ def form_tag_with_honeypot(url_for_options = {}, options = {}, *parameters_for_u
honeypot = options.delete(:honeypot) honeypot = options.delete(:honeypot)
html = form_tag_without_honeypot(url_for_options, options, *parameters_for_url, &block) html = form_tag_without_honeypot(url_for_options, options, *parameters_for_url, &block)
if honeypot if honeypot
captcha = (Rails.version > "3") ? honey_pot_captcha.html_safe : honey_pot_captcha
if block_given? if block_given?
html.insert(html.index('</form>'), honey_pot_captcha) html.insert(html.index('</form>'), captcha)
else else
html += honey_pot_captcha html += captcha
end end
end end
html html
Expand Down

0 comments on commit a27b8ae

Please sign in to comment.