Fix for trailing / not matching active and activeChild paths #277

This commit is contained in:
Andy Miller
2015-08-21 13:19:24 -06:00
parent cf867d29a0
commit 86f29ebe57

View File

@@ -1710,7 +1710,7 @@ class Page
*/
public function active()
{
$uri_path = self::getGrav()['uri']->path();
$uri_path = rtrim(self::getGrav()['uri']->path(), '/');
$routes = self::getGrav()['pages']->routes();
if (isset($routes[$uri_path])) {
@@ -1732,7 +1732,7 @@ class Page
{
$uri = self::getGrav()['uri'];
$pages = self::getGrav()['pages'];
$uri_path = $uri->path();
$uri_path = rtrim($uri->path(), '/');
$routes = self::getGrav()['pages']->routes();
if (isset($routes[$uri_path])) {