Prevent replacement of censored words within < and >

git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3147 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-11-28 15:11:02 +00:00
parent e2eceeb357
commit 1be87672a2

View file

@ -1090,15 +1090,16 @@ for($i = 0; $i < $total_posts; $i++)
// //
// Replace naughty words // 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));
} }
// //