diff options
author | Joshua Ballanco <joshua.ballanco@patch.com> | 2011-04-14 23:25:18 -0400 |
---|---|---|
committer | Joshua Ballanco <joshua.ballanco@patch.com> | 2011-04-14 23:25:18 -0400 |
commit | 2adeaa9c90b7559387b55e7a24a7eb82671c88cc (patch) | |
tree | 272eac9d9637cf76b000b825929732d6e1b9ac62 /actionpack/lib/action_controller/vendor/html-scanner/html | |
parent | c09538941fad7929955ada73cc796e918af415ca (diff) | |
download | rails-2adeaa9c90b7559387b55e7a24a7eb82671c88cc.tar.gz rails-2adeaa9c90b7559387b55e7a24a7eb82671c88cc.tar.bz2 rails-2adeaa9c90b7559387b55e7a24a7eb82671c88cc.zip |
Fix for stripping tags from frozen strings.
This returns behavior under Ruby 1.9 to match Ruby 1.8.
Diffstat (limited to 'actionpack/lib/action_controller/vendor/html-scanner/html')
-rw-r--r-- | actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb index 09dd08898c..91a97c02ff 100644 --- a/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +++ b/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb @@ -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 |