Fixed incorrect author provided
authorAlexander Ebert <ebert@woltlab.com>
Sun, 8 Feb 2015 11:29:06 +0000 (12:29 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 8 Feb 2015 11:29:06 +0000 (12:29 +0100)
Closes #1873

wcfsetup/install/files/lib/action/NotificationConfirmAction.class.php

index fa30f9b9f7370bfa26945dc5425bd7cd0e927066..4dfc09be16a1649b4b78a8ad17882e7812ebea2a 100644 (file)
@@ -71,12 +71,20 @@ class NotificationConfirmAction extends AbstractAction {
                $objectType = ObjectTypeCache::getInstance()->getObjectType($event->objectTypeID);
                $objects = $objectType->getProcessor()->getObjectsByIDs(array($this->notification->objectID));
                
+               $userProfile = null;
+               if ($this->notification->authorID) {
+                       $userProfile = new UserProfile(new User($this->notification->authorID));
+               }
+               else {
+                       $userProfile = new UserProfile(new User(null, array('userID' => null, 'username' => WCF::getLanguage()->get('wcf.user.guest'))));
+               }
+               
                $className = $event->className;
                $notificationEvent = new $className($event);
                $notificationEvent->setObject(
                        $this->notification,
                        $objects[$this->notification->objectID],
-                       $unknownAuthor = new UserProfile(new User(null, array('userID' => null, 'username' => WCF::getLanguage()->get('wcf.user.guest')))),
+                       $userProfile,
                        $this->notification->additionalData
                );