From 19c17a7839bcf6acfd2cb9dde2ab7c108447bb03 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 3 Aug 2014 21:13:02 +0200 Subject: [PATCH] Ignore comment/responses from guests when fetch user objects --- .../manager/UserProfileCommentManager.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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()); } -- 2.20.1