@@ -44,10 +44,33 @@ function removeXss($string)
4444 }
4545 //$string = preg_replace('/<script/im','<script',$string);
4646 $ string = htmlspecialchars ($ string );
47-
4847 return $ string ;
4948}
5049
50+ function disableJavascript ($ content ) {
51+ ## disallow Javascript
52+ $ content = str_ireplace ('<script ' ,'< script ' ,$ content );
53+ $ content = str_ireplace ('onmouseover ' ,'on mouse over ' ,$ content );
54+ $ content = str_ireplace ('onmouseout ' ,'on mouse out ' ,$ content );
55+ $ content = str_ireplace ('onmousemove ' ,'on mouse move ' ,$ content );
56+ $ content = str_ireplace ('onmousedown ' ,'on mouse down ' ,$ content );
57+ $ content = str_ireplace ('onclick ' ,'on click ' ,$ content );
58+ $ content = str_ireplace ('ondblclick ' ,'on dbl click ' ,$ content );
59+ $ content = str_ireplace ('onload ' ,'on load ' ,$ content );
60+ $ content = str_ireplace ('onunload ' ,'on unload ' ,$ content );
61+ $ content = str_ireplace ('onerror ' ,'on error ' ,$ content );
62+ $ content = str_ireplace ('onresize ' ,'on resize ' ,$ content );
63+ $ content = str_ireplace ('onblur ' ,'on blue ' ,$ content );
64+ $ content = str_ireplace ('onchange ' ,'on change ' ,$ content );
65+ $ content = str_ireplace ('onfocus ' ,'on focus ' ,$ content );
66+ $ content = str_ireplace ('onselect ' ,'on select ' ,$ content );
67+ $ content = str_ireplace ('onsubmit ' ,'on submit ' ,$ content );
68+ $ content = str_ireplace ('onreset ' ,'on reset ' ,$ content );
69+ $ content = str_ireplace ('onkeyup ' ,'on keyup ' ,$ content );
70+ $ content = str_ireplace ('onkeydown ' ,'on keydown ' ,$ content );
71+ return $ content ;
72+ }
73+
5174/*
5275foreach ($_POST as $key => $val) {
5376 print "POST: $key = $val<br/>";
0 commit comments