From 1be87672a2af645f24c50efd47a3c78825f55a48 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Thu, 28 Nov 2002 15:11:02 +0000 Subject: [PATCH] Prevent replacement of censored words within < and > git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3147 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/viewtopic.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 27d6b92671..3eafc37003 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1090,15 +1090,16 @@ for($i = 0; $i < $total_posts; $i++) // // Replace naughty words // - if ( count($orig_word) ) + if (count($orig_word)) { - if ( $user_sig != '' ) + $post_subject = preg_replace($orig_word, $replacement_word, $post_subject); + + if ($user_sig != '') { - $user_sig = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(' . $orig_word . ', ' . $replacement_word . ', '\\0')", '>' . $user_sig . '<'), 1, -1)); + $user_sig = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1)); } - $post_subject = preg_replace($orig_word, $replacement_word, $post_subject); - $message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(' . $orig_word . ', ' . $replacement_word . ', '\\0')", '>' . $message . '<'), 1, -1)); + $message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1)); } //