cid_to_src.rb 301 B

123456789101112
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class HtmlSanitizer
  3. class CidToSrc < Loofah::Scrubber
  4. def scrub(node)
  5. return CONTINUE if node.name != 'img'
  6. return CONTINUE if !(cid = node.delete 'cid')
  7. node['src'] = "cid:#{cid}"
  8. end
  9. end
  10. end