diff options
author | Xavier Noria <fxn@hashref.com> | 2011-08-31 04:27:59 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-31 04:27:59 -0700 |
commit | 47b8415bef7edb25bb750685d6f9331f044bbd80 (patch) | |
tree | e408066b7c5df43b2e1b2fbc4f0ff5478f5efdab /actionpack/test/template/html-scanner/sanitizer_test.rb | |
parent | 6d772c0953b418da774b2c3bf5cc297508669da7 (diff) | |
parent | e746c4047cd34accd7f63aa5d09cbb35011c24e2 (diff) | |
download | rails-47b8415bef7edb25bb750685d6f9331f044bbd80.tar.gz rails-47b8415bef7edb25bb750685d6f9331f044bbd80.tar.bz2 rails-47b8415bef7edb25bb750685d6f9331f044bbd80.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'actionpack/test/template/html-scanner/sanitizer_test.rb')
-rw-r--r-- | actionpack/test/template/html-scanner/sanitizer_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/html-scanner/sanitizer_test.rb b/actionpack/test/template/html-scanner/sanitizer_test.rb index 678cb9eeeb..62ad6be680 100644 --- a/actionpack/test/template/html-scanner/sanitizer_test.rb +++ b/actionpack/test/template/html-scanner/sanitizer_test.rb @@ -5,6 +5,13 @@ class SanitizerTest < ActionController::TestCase @sanitizer = nil # used by assert_sanitizer end + def test_strip_tags_with_quote + sanitizer = HTML::FullSanitizer.new + string = '<" <img src="trollface.gif" onload="alert(1)"> hi' + + assert_equal ' hi', sanitizer.sanitize(string) + end + def test_strip_tags sanitizer = HTML::FullSanitizer.new assert_equal("<<<bad html", sanitizer.sanitize("<<<bad html")) |