Stop checking the `enable_censorship` option
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 25 Oct 2021 09:16:06 +0000 (11:16 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 25 Oct 2021 09:16:06 +0000 (11:16 +0200)
see WoltLab/WCF#4567

files/lib/data/conversation/message/ConversationMessageAction.class.php

index 6118f93a5daa45dad337e649b2893b53accfb2e5..65ff994d99c8256e524170e44f83de75c186b7a4 100644 (file)
@@ -584,18 +584,15 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
             );
         }
 
-        // search for censored words
-        if (ENABLE_CENSORSHIP) {
-            $result = Censorship::getInstance()->test($message);
-            if ($result) {
-                throw new UserInputException(
-                    'message',
-                    WCF::getLanguage()->getDynamicVariable(
-                        'wcf.message.error.censoredWordsFound',
-                        ['censoredWords' => $result]
-                    )
-                );
-            }
+        $censoredWords = Censorship::getInstance()->test($message);
+        if ($censoredWords) {
+            throw new UserInputException(
+                'message',
+                WCF::getLanguage()->getDynamicVariable(
+                    'wcf.message.error.censoredWordsFound',
+                    ['censoredWords' => $censoredWords]
+                )
+            );
         }
     }