Skip to content

Commit

Permalink
[Haml] Have ErrorReturn blow up when html_safe methods are called on it.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Mar 2, 2010
1 parent f9607ae commit ddd4bc2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/haml/helpers/xss_mods.rb
Expand Up @@ -92,6 +92,13 @@ def haml_xss_html_escape(text)
html_escape(text)
end
end

class ErrorReturn
# Any attempt to treat ErrorReturn as a string should cause it to blow up.
alias_method :html_safe, :to_s
alias_method :html_safe?, :to_s
alias_method :html_safe!, :to_s
end
end
end

Expand Down

0 comments on commit ddd4bc2

Please sign in to comment.