From: Alexander Ebert Date: Mon, 3 Jul 2017 12:21:48 +0000 (+0200) Subject: Improved behavior for missing comment approval permission X-Git-Tag: 3.1.0_Alpha_1~305 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=87202a1699dbdaaeef7ba60b09656e4af7e85ffd;p=GitHub%2FWoltLab%2FWCF.git Improved behavior for missing comment approval permission --- 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);