diff options
author | Nils Adermann <naderman@naderman.de> | 2007-08-19 13:40:53 +0000 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2007-08-19 13:40:53 +0000 |
commit | d104d3d969d2fbc77f1004e0e5369e8c0c15738f (patch) | |
tree | 188b373ce8876398477e517f242a29ae72cab23e /phpBB/viewtopic.php | |
parent | b8b85e5aca616c1e4b43246daa97a11881fb218d (diff) | |
download | forums-d104d3d969d2fbc77f1004e0e5369e8c0c15738f.tar forums-d104d3d969d2fbc77f1004e0e5369e8c0c15738f.tar.gz forums-d104d3d969d2fbc77f1004e0e5369e8c0c15738f.tar.bz2 forums-d104d3d969d2fbc77f1004e0e5369e8c0c15738f.tar.xz forums-d104d3d969d2fbc77f1004e0e5369e8c0c15738f.zip |
- 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
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r-- | phpBB/viewtopic.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index a99279c642..0aa06721eb 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -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']])) |