Skip to content

Commit

Permalink
Avoid errors if a null value is passed to censorText()
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
  • Loading branch information
Sesquipedalian committed May 3, 2022
1 parent 41c8510 commit 1f40453
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3381,7 +3381,7 @@ function censorText(&$text, $force = false)
global $modSettings, $options, $txt;
static $censor_vulgar = null, $censor_proper;

if ((!empty($options['show_no_censored']) && !empty($modSettings['allow_no_censored']) && !$force) || empty($modSettings['censor_vulgar']) || trim($text) === '')
if ((!empty($options['show_no_censored']) && !empty($modSettings['allow_no_censored']) && !$force) || empty($modSettings['censor_vulgar']) || !is_string($text) || trim($text) === '')
return $text;

call_integration_hook('integrate_word_censor', array(&$text));
Expand Down

0 comments on commit 1f40453

Please sign in to comment.