aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2017-08-12 17:01:34 +0700
committerrxu <rxu@mail.ru>2017-08-12 17:01:34 +0700
commit1d808931f687b0307127d6f8165c9c75956c8e20 (patch)
tree5d1d8b60b6df621edaf06b7f76c78bdd2d180f41
parentd9a5c8e9182e0dffdebf09f4db33bd76e9574765 (diff)
downloadforums-1d808931f687b0307127d6f8165c9c75956c8e20.tar
forums-1d808931f687b0307127d6f8165c9c75956c8e20.tar.gz
forums-1d808931f687b0307127d6f8165c9c75956c8e20.tar.bz2
forums-1d808931f687b0307127d6f8165c9c75956c8e20.tar.xz
forums-1d808931f687b0307127d6f8165c9c75956c8e20.zip
[ticket/15318] Make user option to disable word censoring effective again
PHPBB3-15318
-rw-r--r--phpBB/includes/functions_content.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index c3e7a7ceb7..06223027d8 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -557,6 +557,7 @@ function strip_bbcode(&$text, $uid = '')
function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text = true)
{
static $bbcode;
+ global $auth, $config, $user;
global $phpbb_dispatcher, $phpbb_container;
if ($text === '')
@@ -584,6 +585,13 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
// Temporarily switch off viewcensors if applicable
$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)
{
$renderer->set_viewcensors($censor_text);