From c933b697ce0ef15975ce7e8b79079d4dd52f6ce7 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 25 Sep 2016 10:22:16 +0200 Subject: [PATCH] Add missing page access check in `UserOnline::setLocation()` --- .../install/files/lib/data/user/online/UserOnline.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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') { -- 2.20.1