[Mimedefang] strip invalid IMG tag

David F. Skoll dfs at roaringpenguin.com
Mon Nov 29 09:46:21 EST 2004


On Mon, 29 Nov 2004, Kevin A. McGrail wrote:

> search for <img src=(http|https)(.*)>

I would *strongly* encourage you to use HTML::Parser for this task,
and not some homegrown regexp parser.  Otherwise, you could miss
things like:

	<img

	src="http://gotcha.webbugz.org/foo">

and how about:

	<img quux="foo" xyzzy="bar" src="http://gotcha.webbugz.org/foo">

> perform this action on BOTH text/plain and text/html parts using
> HTML::Parser for the html and perl for the text/plain.

Why do it to text/plain parts?  Does anything actually render text/plain
as HTML?  (Outhouse, maybe...)

Regards,

David.



More information about the MIMEDefang mailing list