mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Merge pull request #1542 from brunoais/ticket/11638
[ticket/11638] generate_text_for_display on viewtopic.php
This commit is contained in:
commit
7027610e23
1 changed files with 10 additions and 46 deletions
|
@ -832,39 +832,19 @@ if (!empty($topic_data['poll_start']))
|
||||||
$poll_total += $poll_option['poll_option_total'];
|
$poll_total += $poll_option['poll_option_total'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($poll_info[0]['bbcode_bitfield'])
|
$parse_bbcode_flags = OPTION_FLAG_SMILIES;
|
||||||
|
|
||||||
|
if (empty($poll_info[0]['bbcode_bitfield']))
|
||||||
{
|
{
|
||||||
$poll_bbcode = new bbcode();
|
$parse_bbcode_flags |= OPTION_FLAG_BBCODE;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$poll_bbcode = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
|
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'] = generate_text_for_display($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield'], $parse_bbcode_flags, true);
|
||||||
|
|
||||||
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']);
|
$topic_data['poll_title'] = generate_text_for_display($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield'], $parse_bbcode_flags, true);
|
||||||
$poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$topic_data['poll_title'] = censor_text($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);
|
|
||||||
|
|
||||||
foreach ($poll_info as $poll_option)
|
foreach ($poll_info as $poll_option)
|
||||||
{
|
{
|
||||||
|
@ -1406,29 +1386,13 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
|
||||||
// End signature parsing, only if needed
|
// End signature parsing, only if needed
|
||||||
if ($user_cache[$poster_id]['sig'] && $row['enable_sig'] && empty($user_cache[$poster_id]['sig_parsed']))
|
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']);
|
$parse_flags = ($user_cache[$poster_id]['sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
|
||||||
|
$user_cache[$poster_id]['sig'] = generate_text_for_display($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield'], $parse_flags, true);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the message and subject
|
// Parse the message and subject
|
||||||
$message = censor_text($row['post_text']);
|
$parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
|
||||||
|
$message = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, true);
|
||||||
// Second parse bbcode here
|
|
||||||
if ($row['bbcode_bitfield'])
|
|
||||||
{
|
|
||||||
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$message = bbcode_nl2br($message);
|
|
||||||
$message = smiley_text($message);
|
|
||||||
|
|
||||||
if (!empty($attachments[$row['post_id']]))
|
if (!empty($attachments[$row['post_id']]))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue