From 3ab3e8d55e5009bcce5a341e64a1655c69eeb302 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 18 Jun 2025 07:27:47 +0300 Subject: [PATCH] refactor(censor): add enable check to censorString method --- src/Censor.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Censor.php b/src/Censor.php index a5e699998..dc5c760ce 100644 --- a/src/Censor.php +++ b/src/Censor.php @@ -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); }