Merge pull request #48 from RanAwaySuccessfully/patch-1

fixing xss-blocking regex bug
This commit is contained in:
Alex (Xkeeper) 2018-07-01 15:42:06 -07:00 committed by GitHub
commit 5dfc60ce91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1263,7 +1263,7 @@ function xss_clean($data) {
#$data = preg_replace('#(<[^>]+?[\x00-\x20"\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $data); #$data = preg_replace('#(<[^>]+?[\x00-\x20"\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $data);
do { do {
$old_data = $data; $old_data = $data;
$data = preg_replace('#(<[^>]+?[\x00-\x20"\'])(on|xmlns)([^>]*+)>#iu', '$1DISABLED_$2$3>', $data); $data = preg_replace('#(<[A-Za-z][^>]*?[\x00-\x20"\'])(on|xmlns)([^>]*+)>#iu', '$1DISABLED_$2$3>', $data);
} while ($old_data !== $data); } while ($old_data !== $data);
// Remove javascript: and vbscript: protocols // Remove javascript: and vbscript: protocols