From 354ab0bcdd0b6810ebbcfd6eb37b38e0767a5c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Fri, 24 Oct 2014 20:19:57 +0200 Subject: [PATCH] fix undefined index --- core/Admin/ActionsMenu.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/Admin/ActionsMenu.php b/core/Admin/ActionsMenu.php index 6666eb03..7e9e8b8c 100644 --- a/core/Admin/ActionsMenu.php +++ b/core/Admin/ActionsMenu.php @@ -37,10 +37,10 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener { * Private properties */ /** @var ManiaControl $maniaControl */ - private $maniaControl = null; - private $adminMenuItems = array(); + private $maniaControl = null; + private $adminMenuItems = array(); private $playerMenuItems = array(); - private $initCompleted = false; + private $initCompleted = false; /** * Construct a new Actions Menu instance @@ -134,8 +134,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener { /* * Admin Menu */ - if ($this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_MODERATOR) - ) { + if ($this->maniaControl->getAuthenticationManager()->checkRight($player, AuthenticationManager::AUTH_LEVEL_MODERATOR)) { // Admin Menu Icon Frame $iconFrame = new Frame(); $manialink->add($iconFrame); @@ -287,11 +286,11 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener { */ public function removeMenuItem($order, $playerAction = true) { if ($playerAction) { - if ($this->playerMenuItems[$order]) { + if (isset($this->playerMenuItems[$order])) { unset($this->playerMenuItems[$order]); } } else { - if ($this->playerMenuItems[$order]) { + if (isset($this->playerMenuItems[$order])) { unset($this->adminMenuItems[$order]); } }