diff --git a/phpBB/modcp.php b/phpBB/modcp.php index a3142c28de..802bac2d0d 100644 --- a/phpBB/modcp.php +++ b/phpBB/modcp.php @@ -131,6 +131,11 @@ if ( !empty($topic_id) ) } $topic_row = $db->sql_fetchrow($result); + if (!$topic_row) + { + message_die(GENERAL_MESSAGE, 'Topic_post_not_exist'); + } + $forum_topics = ( $topic_row['forum_topics'] == 0 ) ? 1 : $topic_row['forum_topics']; $forum_id = $topic_row['forum_id']; $forum_name = $topic_row['forum_name']; @@ -146,6 +151,11 @@ else if ( !empty($forum_id) ) } $topic_row = $db->sql_fetchrow($result); + if (!$topic_row) + { + message_die(GENERAL_MESSAGE, 'Forum_not_exist'); + } + $forum_topics = ( $topic_row['forum_topics'] == 0 ) ? 1 : $topic_row['forum_topics']; $forum_name = $topic_row['forum_name']; } diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php index e9d8bc6145..317b07dc99 100644 --- a/phpBB/privmsg.php +++ b/phpBB/privmsg.php @@ -563,9 +563,9 @@ else if ( $mode == 'read' ) // If the board has HTML off but the post has HTML // on then we process it, else leave it alone // - if ( !$board_config['allow_html'] ) + if ( !$board_config['allow_html'] || !$userdata['user_allowhtml']) { - if ( $user_sig != '' && $privmsg['privmsgs_enable_sig'] && $userdata['user_allowhtml'] ) + if ( $user_sig != '') { $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig); } @@ -1528,9 +1528,9 @@ else if ( $submit || $refresh || $mode != '' ) // // Finalise processing as per viewtopic // - if ( !$html_on ) + if ( !$html_on || !$board_config['allow_html'] || !$userdata['user_allowhtml'] ) { - if ( $user_sig != '' || !$userdata['user_allowhtml'] ) + if ( $user_sig != '' ) { $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig); } diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index acade2896d..a5c57f91b8 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1049,9 +1049,9 @@ for($i = 0; $i < $total_posts; $i++) // If the board has HTML off but the post has HTML // on then we process it, else leave it alone // - if ( !$board_config['allow_html'] ) + if ( !$board_config['allow_html'] || !$userdata['user_allowhtml']) { - if ( $user_sig != '' && $userdata['user_allowhtml'] ) + if ( $user_sig != '' ) { $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig); } @@ -1119,10 +1119,10 @@ for($i = 0; $i < $total_posts; $i++) 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)); } - $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)); } //