Fix ArticleCommentManager::isContentAuthor()
authorMatthias Schmidt <gravatronics@live.com>
Sat, 19 Sep 2020 16:08:46 +0000 (18:08 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 19 Sep 2020 16:08:46 +0000 (18:08 +0200)
The comments belong to article contents, not the article itself.

wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php

index 5a0b97a36d483bbc887c3defe5bab56358d838b7..01958a42e34d3182913ea7fa8a5f065467a4f956 100644 (file)
@@ -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;
        }
 }