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:
parent
c09538941f
commit
2adeaa9c90
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ module HTML
|
||||||
result = super
|
result = super
|
||||||
# strip any comments, and if they have a newline at the end (ie. line with
|
# strip any comments, and if they have a newline at the end (ie. line with
|
||||||
# only a comment) strip that too
|
# 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
|
# Recurse - handle all dirty nested tags
|
||||||
result == text ? result : sanitize(result, options)
|
result == text ? result : sanitize(result, options)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue