12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- class HtmlSanitizer
- PROCESSING_TIMEOUT = Setting.get('html_sanitizer_processing_timeout').to_i.seconds
- UNPROCESSABLE_HTML_MSG = __('This message cannot be displayed due to HTML processing issues. Download the raw message below and open it via an Email client if you still wish to view it.').freeze
- def self.strict(string, external = false, timeout: true)
- HtmlSanitizer::Strict.new.sanitize(string, external: external, timeout: timeout)
- end
- def self.cleanup(string, timeout: true)
- HtmlSanitizer::Cleanup.new.sanitize(string, timeout: timeout)
- end
- def self.replace_inline_images(string, prefix = SecureRandom.uuid)
- HtmlSanitizer::ReplaceInlineImages.new.sanitize(string, prefix)
- end
- def self.dynamic_image_size(string)
- HtmlSanitizer::DynamicImageSize.new.sanitize(string)
- end
- def self.adjust_inline_image_size(string)
- HtmlSanitizer::AdjustInlineImageSize.new.sanitize(string)
- end
- end
|