From: Tim Düsterhus Date: Fri, 22 Oct 2021 09:15:54 +0000 (+0200) Subject: Add early check if censored words are configured in `Censorship::test()` X-Git-Tag: 5.5.0_Alpha_1~355^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=996c2a1a443a18354c05f39eaf07a2a7d4a654da;p=GitHub%2FWoltLab%2FWCF.git Add early check if censored words are configured in `Censorship::test()` --- diff --git a/wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php b/wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php index 028dcbadf1..d51c4f0a12 100644 --- a/wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php +++ b/wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php @@ -77,6 +77,10 @@ class Censorship extends SingletonFactory */ public function test($text) { + if (empty($this->censoredWords)) { + return false; + } + // reset values $this->matches = $this->words = [];