<?php
function xssfilter($inp){
$inp = html_entity_decode(urldecode($inp));
$inp = preg_replace('/!/','',$inp);
if (preg_match('/script|on|xmlns|data/iu',$inp)){
while(preg_match('/script|on|xmlns|data/iu',$inp)){
$inp = preg_replace('/(script)|(on)|(xmlns)|(data)/iu','NO!',$inp);
}
}
return $inp;
}
echo xssfilter('&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;: alert('XSS');');
- Output for 7.0.0 - 7.0.4
- Parse error: syntax error, unexpected 'XSS' (T_STRING), expecting ',' or ')' in /in/OuGGk on line 14
Process exited with code 255. - Output for 5.5.0 - 5.5.33, 5.6.0 - 5.6.19
- Parse error: syntax error, unexpected 'XSS' (T_STRING) in /in/OuGGk on line 14
Process exited with code 255.
preferences:
222.06 ms | 1395 KiB | 65 Q