summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-11-11 13:02:15 +0100
committerAndrey Andreev <narf@devilix.net>2013-11-11 13:02:15 +0100
commitc761a206def7714d18623d46b05adc2bbeedce21 (patch)
tree332caeb8179aaff123881c085245a0d1bacb5ff7 /system
parent61c124b37289657c50634a64d6f3921bea05213e (diff)
Polish changes from PR #2712
Diffstat (limited to 'system')
-rw-r--r--system/core/Router.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/system/core/Router.php b/system/core/Router.php
index 9071f84b7..d467d60fd 100644
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -346,7 +346,7 @@ class CI_Router {
$uri = implode('/', $this->uri->segments);
// Get HTTP verb
- $http_verb = strtolower($_SERVER['REQUEST_METHOD']);
+ $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';
// Is there a literal match? If so we're done
if (isset($this->routes[$uri]))
@@ -356,7 +356,7 @@ class CI_Router {
{
return $this->_set_request(explode('/', $this->routes[$uri]));
}
- // Is there any matching http verb?
+ // Is there a matching http verb?
elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb]))
{
return $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));
@@ -369,12 +369,10 @@ class CI_Router {
// Check if route format is using http verb
if (is_array($val))
{
- // Does the http verb match?
if (isset($val[$http_verb]))
{
$val = $val[$http_verb];
}
- // No match, skip to next rule
else
{
continue;