refactor(censor): add enable check to censorString method

This commit is contained in:
Roman Kelesidis 2025-06-18 07:27:47 +03:00
commit 3ab3e8d55e
No known key found for this signature in database
GPG key ID: D8157C4D4C4C6DB4

View file

@ -67,7 +67,7 @@ class Censor
{
global $datastore;
if (!config()->get('use_word_censor')) {
if (!$this->isEnabled()) {
return;
}
@ -88,6 +88,10 @@ class Censor
*/
public function censorString(string $word): string
{
if (!$this->isEnabled()) {
return $word;
}
return preg_replace($this->words, $this->replacements, $word);
}