NavigationItem: Provide a more sophisticated conflict detection

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-07 13:20:49 +02:00
parent 0feaec7af1
commit bf2cb9ab7e
1 changed files with 5 additions and 1 deletions

View File

@ -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());
}
/**