From 5c40eb6b78367d0d76f361a65f196023e3f540dc Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 23 Feb 2003 00:54:46 +0000 Subject: [PATCH] fix issue with HTML parsing and nasty on/style tags + incorrect matching of allowed tags git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3513 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } }