Skip to content

Commit a06f166

Browse files
authored
Merge pull request #7 from nurmanhabib/feature/v5
Fix some issue
2 parents 1f5dbe6 + 21ef61f commit a06f166

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Activators/LinkActivator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ protected function matchPath(Nav $nav)
2828
$pathPattern = trim(parse_url($this->uri, PHP_URL_PATH), '/') . '/';
2929
$navPattern = ltrim($nav->getPattern(), '/');
3030

31+
if (empty($navPattern)) {
32+
return false;
33+
}
34+
3135
return strpos($pathPattern, $navPattern) !== false || fnmatch($navPattern, $pathPattern);
3236
}
3337

src/Activators/RequestUriActivator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class RequestUriActivator extends LinkActivator
66
{
77
public function __construct()
88
{
9-
parent::__construct($_SERVER['REQUEST_URI']);
9+
parent::__construct(key_exists('REQUEST_URI', $_SERVER) ? $_SERVER['REQUEST_URI'] : null);
1010
}
1111
}

0 commit comments

Comments
 (0)