mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-24 02:48:56 +00:00
- modcp bugfix (empty topic/forum id)
- fix user signature problems (html globally turned off/on) git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5099 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
c91ddb6029
commit
5bcbf8f939
3 changed files with 18 additions and 8 deletions
|
@ -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'];
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Reference in a new issue