From: Matthias Schmidt Date: Sun, 3 Aug 2014 19:13:02 +0000 (+0200) Subject: Ignore comment/responses from guests when fetch user objects X-Git-Tag: 2.1.0_Alpha_1~479 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=19c17a7839bcf6acfd2cb9dde2ab7c108447bb03;p=GitHub%2FWoltLab%2FWCF.git Ignore comment/responses from guests when fetch user objects --- 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 2cbf1741c4..d4dce40bce 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php @@ -156,7 +156,9 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa foreach ($responses as $response) { $commentIDs[] = $response->commentID; - $userIDs[] = $response->userID; + if ($response->userID) { + $userIDs[] = $response->userID; + } } } @@ -170,7 +172,9 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa $users = array(); foreach ($comments as $comment) { $userIDs[] = $comment->objectID; - $userIDs[] = $comment->userID; + if ($comment->userID) { + $userIDs[] = $comment->userID; + } } if (!empty($userIDs)) { $userList = new UserProfileList(); @@ -210,7 +214,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa if (isset($users[$comment->objectID]) && !$users[$comment->objectID]->isProtected()) { $like->setIsAccessible(); - + // short output $text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.com.woltlab.wcf.user.profileComment.response', array( 'responseAuthor' => $comment->userID ? $users[$response->userID] : null, @@ -219,7 +223,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa 'like' => $like )); $like->setTitle($text); - + // output $like->setDescription($response->getExcerpt()); }