Add early check if censored words are configured in `Censorship::test()`
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 22 Oct 2021 09:15:54 +0000 (11:15 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 22 Oct 2021 09:21:18 +0000 (11:21 +0200)
wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php

index 028dcbadf1e600828bb60360535253289f1fa40e..d51c4f0a12cc0087a78f2018a0b568b706f4093e 100644 (file)
@@ -77,6 +77,10 @@ class Censorship extends SingletonFactory
      */
     public function test($text)
     {
+        if (empty($this->censoredWords)) {
+            return false;
+        }
+
         // reset values
         $this->matches = $this->words = [];