Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Regex: Strip <script> tags?

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

Steve
--

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://605863]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-25 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found