diff options
author | Timm <kaspth@gmail.com> | 2014-05-23 23:21:01 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-16 21:04:23 +0200 |
commit | 427f3f90d4b20260a6de0990b05b74784a457ff0 (patch) | |
tree | 230325e48b0aa7ccb4d451a1d0d803acdf84f07a /actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb | |
parent | 5d3a29229ba0a52c78d13aad99ac508f96778d77 (diff) | |
download | rails-427f3f90d4b20260a6de0990b05b74784a457ff0.tar.gz rails-427f3f90d4b20260a6de0990b05b74784a457ff0.tar.bz2 rails-427f3f90d4b20260a6de0990b05b74784a457ff0.zip |
Add a layer of indirection making sanitizers pluggable.
Diffstat (limited to 'actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb')
-rw-r--r-- | actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb b/actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb index ed34eecf55..36ec3ef6b3 100644 --- a/actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb +++ b/actionview/lib/action_view/vendor/html-scanner/html/sanitizer.rb @@ -3,6 +3,20 @@ require 'cgi' require 'active_support/core_ext/module/attribute_accessors' module HTML + module Scanner + def full_sanitizer + HTML::FullSanitizer + end + + def link_sanitizer + HTML::LinkSanitizer + end + + def white_list_sanitizer + HTML::WhiteListSanitizer + end + end + class Sanitizer def sanitize(text, options = {}) validate_options(options) |