1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix for stripping tags from frozen strings.

This returns behavior under Ruby 1.9 to match Ruby 1.8.
This commit is contained in:
Joshua Ballanco 2011-04-14 23:25:18 -04:00
parent c09538941f
commit 2adeaa9c90

View file

@ -33,7 +33,7 @@ module HTML
result = super
# strip any comments, and if they have a newline at the end (ie. line with
# only a comment) strip that too
result.gsub!(/<!--(.*?)-->[\n]?/m, "") if result
result = result.gsub(/<!--(.*?)-->[\n]?/m, "") if (result && result =~ /<!--(.*?)-->[\n]?/m)
# Recurse - handle all dirty nested tags
result == text ? result : sanitize(result, options)
end