From eed10159fdecfd33064d7bef0f799f2076f31e7e Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 21 Nov 2014 17:39:18 +0100 Subject: [PATCH] Menu: Don't render sub menus when a dot appears in the label I guess this was intended to be a feature. Turns out to be a bug though :) fixes #7772 --- library/Icinga/Web/Menu.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index 9362bbb6a..dafe66a90 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -437,21 +437,8 @@ class Menu implements RecursiveIterator */ public function addSubMenu($id, ConfigObject $menuConfig = null) { - if (false === ($pos = strpos($id, '.'))) { - $subMenu = new static($id, $menuConfig, $this); - $this->subMenus[$id] = $subMenu; - } else { - list($parentId, $id) = explode('.', $id, 2); - - if ($this->hasSubMenu($parentId)) { - $parent = $this->getSubMenu($parentId); - } else { - $parent = $this->addSubMenu($parentId); - } - - $subMenu = $parent->addSubMenu($id, $menuConfig); - } - + $subMenu = new static($id, $menuConfig, $this); + $this->subMenus[$id] = $subMenu; return $subMenu; }