Welcome to the Monastery | |
PerlMonks |
Re: Regex: Strip <script> tags?by skx (Parson) |
on Mar 21, 2007 at 15:29 UTC ( [id://605863]=note: print w/replies, xml ) | Need Help?? |
There are a lot more things that you'll need to worry about than just raw <script> tags. For example: <a href="http://example.com" onClick="alert(1);">test</a> To deal with this complexity properly you should be looking at using one of the filtering modules available from CPAN. I've got good experience of using HTML::Scrubber - but there are a few more including HTML::EscapeEvil and HTML::Sanitizer
In Section
Seekers of Perl Wisdom
|
|