From 996c2a1a443a18354c05f39eaf07a2a7d4a654da Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 22 Oct 2021 11:15:54 +0200 Subject: [PATCH] Add early check if censored words are configured in `Censorship::test()` --- .../files/lib/system/message/censorship/Censorship.class.php | 4 ++++ 1 file changed, 4 insertions(+) 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 = []; -- 2.20.1