From 1e5365ba51c07498cd3cb83aba49645e349bfe3e Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 24 Apr 2015 17:13:14 -0600 Subject: [PATCH] fix for home path not dispatching correctly --- system/src/Grav/Common/Uri.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Common/Uri.php b/system/src/Grav/Common/Uri.php index 60546dc39..5fa33649c 100644 --- a/system/src/Grav/Common/Uri.php +++ b/system/src/Grav/Common/Uri.php @@ -105,8 +105,10 @@ class Uri parse_str($this->bits['query'], $this->query); } + $path = $this->bits['path']; + $this->paths = array(); - $this->path = $this->bits['path']; + $this->path = $path; $this->content_path = trim(str_replace($this->base, '', $this->path), '/'); if ($this->content_path != '') { $this->paths = explode('/', $this->content_path); @@ -136,7 +138,7 @@ class Uri $path[] = $bit; } } - $uri = implode('/', $path); + $uri = '/' . ltrim(implode('/', $path), '/'); } return $uri; } @@ -249,7 +251,11 @@ class Uri */ public function path() { - return $this->path; + $path = $this->path(); + if ($path === '') { + $path = '/'; + } + return $path; } /**