mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 22:33:55 -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;
|
global $datastore;
|
||||||
|
|
||||||
if (!config()->get('use_word_censor')) {
|
if (!$this->isEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,6 +88,10 @@ class Censor
|
||||||
*/
|
*/
|
||||||
public function censorString(string $word): string
|
public function censorString(string $word): string
|
||||||
{
|
{
|
||||||
|
if (!$this->isEnabled()) {
|
||||||
|
return $word;
|
||||||
|
}
|
||||||
|
|
||||||
return preg_replace($this->words, $this->replacements, $word);
|
return preg_replace($this->words, $this->replacements, $word);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue