Skip to content

Commit

Permalink
[Haml] Don't run html_safe on form_tag if it's not actually returning…
Browse files Browse the repository at this point in the history
… a string.
  • Loading branch information
nex3 committed Mar 2, 2010
1 parent 76fa7cc commit f9607ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/haml/helpers/xss_mods.rb
Expand Up @@ -99,7 +99,9 @@ module ActionView
module Helpers
module FormTagHelper
def form_tag_with_haml_xss(*args, &block)
Haml::Util.html_safe(form_tag_without_haml_xss(*args, &block))
res = form_tag_without_haml_xss(*args, &block)
res = Haml::Util.html_safe(res) unless block_given?
res
end
alias_method :form_tag_without_haml_xss, :form_tag
alias_method :form_tag, :form_tag_with_haml_xss
Expand Down

0 comments on commit f9607ae

Please sign in to comment.