diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-03-07 18:48:06 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-03-10 20:04:01 +0100 |
commit | 37695b8aabc1386f21039b16c32541d71f0d4182 (patch) | |
tree | 1b6b3ec5dabb35507527f6d7f94ca22b843d8480 /actionview/lib/action_view/helpers/sanitize_helper.rb | |
parent | 96b8f401f58e9ed4ea41aa32a2b34850640ac0d7 (diff) | |
download | rails-37695b8aabc1386f21039b16c32541d71f0d4182.tar.gz rails-37695b8aabc1386f21039b16c32541d71f0d4182.tar.bz2 rails-37695b8aabc1386f21039b16c32541d71f0d4182.zip |
Let strip_tags leave HTML escaping to Rails.
Prevents double escaping errors, such as "&" becoming "&amp;".
Diffstat (limited to 'actionview/lib/action_view/helpers/sanitize_helper.rb')
-rw-r--r-- | actionview/lib/action_view/helpers/sanitize_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/sanitize_helper.rb b/actionview/lib/action_view/helpers/sanitize_helper.rb index 463a4e9f60..a2e9f37453 100644 --- a/actionview/lib/action_view/helpers/sanitize_helper.rb +++ b/actionview/lib/action_view/helpers/sanitize_helper.rb @@ -99,7 +99,7 @@ module ActionView # strip_tags("<div id='top-bar'>Welcome to my website!</div>") # # => Welcome to my website! def strip_tags(html) - self.class.full_sanitizer.sanitize(html) + self.class.full_sanitizer.sanitize(html, encode_special_chars: false) end # Strips all link tags from +html+ leaving just the link text. |