1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

- BBCode parsing order should ALWAYS be censor_text(), bbcode_secon_pass(), bbcode_nl2br(), smiley_text(), parse_attachments()

- using \r on custom bbcodes to allow line breaks [Bug #10758]


git-svn-id: file:///svn/phpbb/trunk@8050 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann
2007-08-19 13:40:53 +00:00
parent b8b85e5aca
commit d104d3d969
19 changed files with 57 additions and 45 deletions

View File

@@ -747,23 +747,24 @@ if (!empty($topic_data['poll_start']))
for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
{
$poll_info[$i]['poll_option_text'] = censor_text($poll_info[$i]['poll_option_text']);
$poll_info[$i]['poll_option_text'] = str_replace("\n", '<br />', $poll_info[$i]['poll_option_text']);
if ($poll_bbcode !== false)
{
$poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
}
$poll_info[$i]['poll_option_text'] = bbcode_nl2br($poll_info[$i]['poll_option_text']);
$poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
}
$topic_data['poll_title'] = censor_text($topic_data['poll_title']);
$topic_data['poll_title'] = str_replace("\n", '<br />', $topic_data['poll_title']);
if ($poll_bbcode !== false)
{
$poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']);
}
$topic_data['poll_title'] = bbcode_nl2br($topic_data['poll_title']);
$topic_data['poll_title'] = smiley_text($topic_data['poll_title']);
unset($poll_bbcode);
@@ -1222,13 +1223,13 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
if ($user_cache[$poster_id]['sig'] && $row['enable_sig'] && empty($user_cache[$poster_id]['sig_parsed']))
{
$user_cache[$poster_id]['sig'] = censor_text($user_cache[$poster_id]['sig']);
$user_cache[$poster_id]['sig'] = str_replace("\n", '<br />', $user_cache[$poster_id]['sig']);
if ($user_cache[$poster_id]['sig_bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield']);
}
$user_cache[$poster_id]['sig'] = bbcode_nl2br($user_cache[$poster_id]['sig']);
$user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']);
$user_cache[$poster_id]['sig_parsed'] = true;
}
@@ -1242,9 +1243,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
$message = str_replace("\n", '<br />', $message);
// Always process smilies after parsing bbcodes
$message = bbcode_nl2br($message);
$message = smiley_text($message);
if (!empty($attachments[$row['post_id']]))