scinote-web/app/helpers/input_sanitize_helper.rb

14 lines
284 B
Ruby
Raw Normal View History

2017-01-03 05:27:12 +08:00
module InputSanitizeHelper
def sanitize_input(text)
ActionController::Base.helpers.sanitize(
text,
tags: Constants::WHITELISTED_TAGS,
attributes: Constants::WHITELISTED_ATTRIBUTES
)
2017-01-03 05:27:12 +08:00
end
def escape_input(text)
ERB::Util.html_escape(text)
end
2017-01-03 05:27:12 +08:00
end