From: Matthias Schmidt Date: Sat, 19 Sep 2020 16:08:46 +0000 (+0200) Subject: Fix ArticleCommentManager::isContentAuthor() X-Git-Tag: 5.3.0_Beta_1~23 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dd78ed09c3f82c4300127c8e1f262911e63c4a0e;p=GitHub%2FWoltLab%2FWCF.git Fix ArticleCommentManager::isContentAuthor() The comments belong to article contents, not the article itself. --- 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 5a0b97a36d..01958a42e3 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php @@ -7,7 +7,7 @@ use wcf\data\comment\response\CommentResponseList; use wcf\data\comment\CommentList; use wcf\data\object\type\ObjectTypeCache; use wcf\system\cache\runtime\UserProfileRuntimeCache; -use wcf\system\cache\runtime\ViewableArticleRuntimeCache; +use wcf\system\cache\runtime\ViewableArticleContentRuntimeCache; use wcf\system\like\IViewableLikeProvider; use wcf\system\WCF; @@ -214,7 +214,7 @@ class ArticleCommentManager extends AbstractCommentManager implements IViewableL * @inheritDoc */ public function isContentAuthor($commentOrResponse) { - $article = ViewableArticleRuntimeCache::getInstance()->getObject($this->getObjectID($commentOrResponse)); - return $commentOrResponse->userID && $article->userID == $commentOrResponse->userID; + $articleContent = ViewableArticleContentRuntimeCache::getInstance()->getObject($this->getObjectID($commentOrResponse)); + return $commentOrResponse->userID && $articleContent->getArticle()->userID == $commentOrResponse->userID; } }