Sha256: 8153828484134ab88e7f758740af412f94d9da4378388bd6d0165e9238bd0fa1
Contents?: true
Size: 680 Bytes
Versions: 9
Compression:
Stored size: 680 Bytes
Contents
module Loofah module Helpers class << self # # A replacement for Rails's built-in +strip_tags+ helper. # # Loofah::Helpers.strip_tags("<div>Hello <b>there</b></div>") # => "Hello there" # def strip_tags(string_or_io) Loofah.fragment(string_or_io).text end # # A replacement for Rails's built-in +sanitize+ helper. # # Loofah::Helpers.sanitize("<script src=http://ha.ckers.org/xss.js></script>") # => "<script src=\"http://ha.ckers.org/xss.js\"></script>" # def sanitize(string_or_io) Loofah.scrub_fragment(string_or_io, :strip).to_s end end end end
Version data entries
9 entries across 9 versions & 1 rubygems