Skip to content
Browse files

Fix for stripping tags from frozen strings.

This returns behavior under Ruby 1.9 to match Ruby 1.8.
  • Loading branch information...
1 parent c095389 commit 2adeaa9c90b7559387b55e7a24a7eb82671c88cc @jballanc jballanc committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
View
2 actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
@@ -33,7 +33,7 @@ def sanitize(text, options = {})
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

0 comments on commit 2adeaa9

Please sign in to comment.
Something went wrong with that request. Please try again.