Browse code

includes/corefunctions.php: update javascript stripping regex - from @ariadoss

Clarissa Walker authored on 2026/10/27 12:27:13
Showing 1 changed files
... ...
@@ -97,7 +97,7 @@ function descript($text) {
97 97
 
98 98
 	// remove any attribute starting with "on" or xmlns
99 99
 
100
-	$text = preg_replace('#(<[^>]+[\\"\'\s])(onmouseover|onmousedown|onmouseup|onmouseout|onmousemove|onclick|ondblclick|onload|xmlns)[^>]*>#iU', ">", $text);
100
+	$text = preg_replace('#(<[^>]+[\\"\'\s])(on[a-z]+|xmlns)[^>]*>#iU', ">", $text);
101 101
 
102 102
 	// remove javascript: and vbscript: protocol
103 103