mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10845] Remove censor from text
In order to remove the censor, I added a new parameter to generate_text_for_display(), that new parameter is used to tell if the text should be censored or not. Defaults to true. PHPBB3-10845
This commit is contained in:
parent
06f4ef8852
commit
593ef78859
2 changed files with 6 additions and 3 deletions
|
@ -408,7 +408,7 @@ function strip_bbcode(&$text, $uid = '')
|
||||||
* For display of custom parsed text on user-facing pages
|
* For display of custom parsed text on user-facing pages
|
||||||
* Expects $text to be the value directly from the database (stored value)
|
* Expects $text to be the value directly from the database (stored value)
|
||||||
*/
|
*/
|
||||||
function generate_text_for_display($text, $uid, $bitfield, $flags)
|
function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text = true)
|
||||||
{
|
{
|
||||||
static $bbcode;
|
static $bbcode;
|
||||||
|
|
||||||
|
@ -417,7 +417,10 @@ function generate_text_for_display($text, $uid, $bitfield, $flags)
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = censor_text($text);
|
if ($censor_text)
|
||||||
|
{
|
||||||
|
$text = censor_text($text);
|
||||||
|
}
|
||||||
|
|
||||||
// Parse bbcode if bbcode uid stored and bbcode enabled
|
// Parse bbcode if bbcode uid stored and bbcode enabled
|
||||||
if ($uid && ($flags & OPTION_FLAG_BBCODE))
|
if ($uid && ($flags & OPTION_FLAG_BBCODE))
|
||||||
|
|
|
@ -227,7 +227,7 @@ class mcp_reports
|
||||||
'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']),
|
'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']),
|
||||||
'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']),
|
'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']),
|
||||||
|
|
||||||
'POST_PREVIEW' => bbcode_nl2br(generate_text_for_display($report['reported_post_text'], $report['reported_post_uid'], $report['reported_post_bitfield'], OPTION_FLAG_BBCODE + OPTION_FLAG_SMILIES + OPTION_FLAG_LINKS)),
|
'POST_PREVIEW' => generate_text_for_display($report['reported_post_text'], $report['reported_post_uid'], $report['reported_post_bitfield'], OPTION_FLAG_BBCODE | OPTION_FLAG_SMILIES, false),
|
||||||
'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'],
|
'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'],
|
||||||
'POST_DATE' => $user->format_date($post_info['post_time']),
|
'POST_DATE' => $user->format_date($post_info['post_time']),
|
||||||
'POST_IP' => $post_info['poster_ip'],
|
'POST_IP' => $post_info['poster_ip'],
|
||||||
|
|
Loading…
Add table
Reference in a new issue