From c761a206def7714d18623d46b05adc2bbeedce21 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Nov 2013 14:02:15 +0200 Subject: Polish changes from PR #2712 --- system/core/Router.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'system/core/Router.php') 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; -- cgit v1.2.3-24-g4f1b