From 87202a1699dbdaaeef7ba60b09656e4af7e85ffd Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 3 Jul 2017 14:21:48 +0200 Subject: [PATCH] Improved behavior for missing comment approval permission --- .../comment/manager/AbstractCommentManager.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php index 7a8e7c9bca..7c9a3c98ca 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php @@ -86,7 +86,12 @@ abstract class AbstractCommentManager extends SingletonFactory implements IComme } if (empty($this->permissionAddWithoutModeration)) { - return false; + if (ENABLE_DEBUG_MODE) { + throw new \RuntimeException("Missing permission name to create comments without approval."); + } + + // backwards-compatibility in production mode + return true; } return (WCF::getSession()->getPermission($this->permissionAddWithoutModeration) ? true : false); -- 2.20.1