From 6d315d8288f34fd6153316b788ea2dba689f6669 Mon Sep 17 00:00:00 2001 From: Joe Simpson Date: Sun, 23 Mar 2014 17:00:50 +0000 Subject: [PATCH 1/4] Allow for the use of PATH_INFO This allows for the Apache server variable, PATH_INFO to be used. --- src/Klein/Request.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Klein/Request.php b/src/Klein/Request.php index 9ee35602..44050776 100644 --- a/src/Klein/Request.php +++ b/src/Klein/Request.php @@ -433,7 +433,9 @@ public function userAgent() */ public function uri() { - return $this->server->get('REQUEST_URI', '/'); + $p = $this->server->get('PATH_INFO'); + if(!$p) $p = $this->server->get('REQUEST_URI', '/'); + return $p; } /** From 183c7510940c7b7ea872997ac605477dbdaa2322 Mon Sep 17 00:00:00 2001 From: Joe Simpson Date: Sun, 23 Mar 2014 17:09:01 +0000 Subject: [PATCH 2/4] Fix Travis CI warning Inline conditionals are not allowed --- src/Klein/Request.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Klein/Request.php b/src/Klein/Request.php index 44050776..0ad03513 100644 --- a/src/Klein/Request.php +++ b/src/Klein/Request.php @@ -434,7 +434,10 @@ public function userAgent() public function uri() { $p = $this->server->get('PATH_INFO'); - if(!$p) $p = $this->server->get('REQUEST_URI', '/'); + if(!$p) + { + $p = $this->server->get('REQUEST_URI', '/'); + } return $p; } From 57d95843c972378baa0ee7e171f2754bae14dd58 Mon Sep 17 00:00:00 2001 From: Joe Simpson Date: Sun, 23 Mar 2014 17:11:57 +0000 Subject: [PATCH 3/4] hopefully nailed it --- src/Klein/Request.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Klein/Request.php b/src/Klein/Request.php index 0ad03513..259ba2d6 100644 --- a/src/Klein/Request.php +++ b/src/Klein/Request.php @@ -434,8 +434,7 @@ public function userAgent() public function uri() { $p = $this->server->get('PATH_INFO'); - if(!$p) - { + if (!$p) { $p = $this->server->get('REQUEST_URI', '/'); } return $p; From cd5ce9b05fa96a870abf4d161b267aaf60d13dcc Mon Sep 17 00:00:00 2001 From: Joe Simpson Date: Fri, 24 Oct 2014 12:48:05 +0100 Subject: [PATCH 4/4] Update Request.php --- src/Klein/Request.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Klein/Request.php b/src/Klein/Request.php index 259ba2d6..a207ce87 100644 --- a/src/Klein/Request.php +++ b/src/Klein/Request.php @@ -433,11 +433,12 @@ public function userAgent() */ public function uri() { - $p = $this->server->get('PATH_INFO'); - if (!$p) { - $p = $this->server->get('REQUEST_URI', '/'); + $uri = $this->server->get('PATH_INFO'); + if (!empty($uri)) + { + $uri = $this->server->get('REQUEST_URI', '/'); } - return $p; + return $uri; } /**