mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
refactor(censor): add enable check to censorString method
This commit is contained in:
parent
7fddf2f0fc
commit
3ab3e8d55e
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue