From 485163142d277765a55501a1856543a53cede2b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 10 Aug 2020 12:01:43 +0200 Subject: [PATCH] =?utf8?q?Prevent=20guests=20from=20being=20a=20comment?= =?utf8?q?=E2=80=99s=20content=20author?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../lib/system/comment/manager/ArticleCommentManager.class.php | 2 +- .../system/comment/manager/UserProfileCommentManager.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php index d3b7de04b8..5a0b97a36d 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php @@ -215,6 +215,6 @@ class ArticleCommentManager extends AbstractCommentManager implements IViewableL */ public function isContentAuthor($commentOrResponse) { $article = ViewableArticleRuntimeCache::getInstance()->getObject($this->getObjectID($commentOrResponse)); - return $article->userID == $commentOrResponse->userID; + return $commentOrResponse->userID && $article->userID == $commentOrResponse->userID; } } diff --git a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php index 2675092639..ae9aaccc0d 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php @@ -257,6 +257,6 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa */ public function isContentAuthor($commentOrResponse) { $userID = $this->getObjectID($commentOrResponse); - return $userID == $commentOrResponse->userID; + return $commentOrResponse->userID && $userID == $commentOrResponse->userID; } } -- 2.20.1