diff --git a/phpBB/includes/functions_post.php b/phpBB/includes/functions_post.php index b5ae99d289..d4cf5ae483 100644 --- a/phpBB/includes/functions_post.php +++ b/phpBB/includes/functions_post.php @@ -72,9 +72,9 @@ function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid for ($i = 0; $i < sizeof($allowed_html_tags); $i++) { $match_tag = trim($allowed_html_tags[$i]); - if (preg_match('#^<\/?' . $match_tag . '(?!(.*?)((style)|( on[\w]+?[\s]?=))[\s]*?)#i', $hold_string)) + if (preg_match('#^<\/?' . $match_tag . '[> ]#i', $hold_string)) { - $tagallowed = true; + $tagallowed = (preg_match('#^<\/?' . $match_tag . ' .*?(style[ ]*?=|on[\w]+[ ]*?=)#i', $hold_string)) ? false : true; } }