From: Matthias Schmidt Date: Sun, 25 Sep 2016 08:22:16 +0000 (+0200) Subject: Add missing page access check in `UserOnline::setLocation()` X-Git-Tag: 3.0.0_Beta_2~156^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c933b697ce0ef15975ce7e8b79079d4dd52f6ce7;p=GitHub%2FWoltLab%2FWCF.git Add missing page access check in `UserOnline::setLocation()` --- diff --git a/wcfsetup/install/files/lib/data/user/online/UserOnline.class.php b/wcfsetup/install/files/lib/data/user/online/UserOnline.class.php index 93554d1c30..c46863ddc3 100644 --- a/wcfsetup/install/files/lib/data/user/online/UserOnline.class.php +++ b/wcfsetup/install/files/lib/data/user/online/UserOnline.class.php @@ -57,10 +57,9 @@ class UserOnline extends UserProfile { /** * Sets the location of the user. If no location is given, the method tries to * automatically determine the location. - * Returns true if the location has been successfully set. * * @param string|null $location - * @return boolean + * @return boolean `true` if the location has been successfully set, otherwise `false` */ public function setLocation($location = null) { if ($location === null) { @@ -73,8 +72,7 @@ class UserOnline extends UserProfile { $this->location = $page->getHandler()->getOnlineLocation($page, $this); return true; } - else { - // TODO: check if active user may access the page + else if ($page->isAccessible()) { $title = $page->getTitle(); if (!empty($title)) { if ($page->pageType != 'system') {