From bf2cb9ab7e7a68132084a693d90f31f7fcc09cff Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 7 Sep 2015 13:20:49 +0200 Subject: [PATCH] NavigationItem: Provide a more sophisticated conflict detection refs #5600 --- library/Icinga/Web/Navigation/NavigationItem.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Web/Navigation/NavigationItem.php b/library/Icinga/Web/Navigation/NavigationItem.php index 4a99fa295..c56dab7e4 100644 --- a/library/Icinga/Web/Navigation/NavigationItem.php +++ b/library/Icinga/Web/Navigation/NavigationItem.php @@ -596,11 +596,15 @@ class NavigationItem implements IteratorAggregate */ public function conflictsWith(NavigationItem $item) { + if (! $item instanceof $this) { + return false; + } + if ($this->getUrl() === null || $item->getUrl() === null) { return false; } - return $this->getUrl() !== $item->getUrl(); + return !$this->getUrl()->matches($item->getUrl()); } /**