mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
[ticket/15318] Make user option to disable word censoring effective again
PHPBB3-15318
This commit is contained in:
parent
d9a5c8e918
commit
1d808931f6
1 changed files with 8 additions and 0 deletions
|
@ -557,6 +557,7 @@ function strip_bbcode(&$text, $uid = '')
|
||||||
function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text = true)
|
function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text = true)
|
||||||
{
|
{
|
||||||
static $bbcode;
|
static $bbcode;
|
||||||
|
global $auth, $config, $user;
|
||||||
global $phpbb_dispatcher, $phpbb_container;
|
global $phpbb_dispatcher, $phpbb_container;
|
||||||
|
|
||||||
if ($text === '')
|
if ($text === '')
|
||||||
|
@ -584,6 +585,13 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
|
||||||
|
|
||||||
// Temporarily switch off viewcensors if applicable
|
// Temporarily switch off viewcensors if applicable
|
||||||
$old_censor = $renderer->get_viewcensors();
|
$old_censor = $renderer->get_viewcensors();
|
||||||
|
|
||||||
|
// Check here if the user is having viewing censors disabled (and also allowed to do so).
|
||||||
|
if (!$user->optionget('viewcensors') && $config['allow_nocensors'] && $auth->acl_get('u_chgcensors'))
|
||||||
|
{
|
||||||
|
$censor_text = false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($old_censor !== $censor_text)
|
if ($old_censor !== $censor_text)
|
||||||
{
|
{
|
||||||
$renderer->set_viewcensors($censor_text);
|
$renderer->set_viewcensors($censor_text);
|
||||||
|
|
Loading…
Add table
Reference in a new issue