Subject: | removing script code often fails |
The new option for removing script code uses the following regular
expression:
$gabarit=~s/<script([^>]*)>[^<]*<\/script>//iegmx;
However, this regexp does not allow the '<' character in the script code
and therefore this will fail for most javascript code like:
<script language=JavaScript type=text/javascript>
<!-- // '<' character here!!!
//code here
-->
</script>
or:
<script language=JavaScript type=text/javascript>
for(i=0; i<10; i++) // '<' character here!!!
do_something();
</script>
So it really should be:
$gabarit=~s/<script([^>]*)>[\s\S]*?<\/script>//iegmx;