Skip to content

Commit

Permalink
code security updates
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Aug 22, 2024
1 parent f9bf84f commit b75770a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/html2doc/mime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ def mime_package(result, filename, dir)
end

def contentid(mhtml)
mhtml.gsub %r{(<img[^>]*?src=")([^"'<]+)(['"])}m do |m|
mhtml.gsub %r{(<img[^<>]*?src=")([^"'<]+)(['"])}m do |m|
repl = "#{$1}cid:#{File.basename($2)}#{$3}"
/^data:|^https?:/ =~ $2 ? m : repl
end.gsub %r{(<v:imagedata[^>]*?src=")([^"'<]+)(['"])}m do |m|
end.gsub %r{(<v:imagedata[^<>]*?src=")([^"'<]+)(['"])}m do |m|
repl = "#{$1}cid:#{File.basename($2)}#{$3}"
/^data:|^https?:/ =~ $2 ? m : repl
end
Expand Down

0 comments on commit b75770a

Please sign in to comment.