diff --git a/classes/input.php b/classes/input.php index fac9fc6586..e0da058bee 100644 --- a/classes/input.php +++ b/classes/input.php @@ -82,17 +82,7 @@ public static function uri() // Fall back to parsing the REQUEST URI if (isset($_SERVER['REQUEST_URI'])) { - // Some servers require 'index.php?' as the index page - // if we are using mod_rewrite or the server does not require - // the question mark, then parse the url. - if (\Config::get('index_file') != 'index.php?') - { - $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); - } - else - { - $uri = $_SERVER['REQUEST_URI']; - } + $uri = $_SERVER['REQUEST_URI']; } else { @@ -113,6 +103,13 @@ public static function uri() $uri = substr($uri, strlen($index_file)); } + // When index.php? is used and the config is set wrong, lets just + // be nice and help them out. + if ($index_file and strncmp($uri, '?/', 2) === 0) + { + $uri = substr($uri, 1); + } + // Lets split the URI up in case it containes a ?. This would // indecate the server requires 'index.php?' and that mod_rewrite // is not being used. diff --git a/classes/route.php b/classes/route.php index 9938d0f96c..797a4fb08b 100644 --- a/classes/route.php +++ b/classes/route.php @@ -38,9 +38,10 @@ class Route { public function __construct($path, $translation = null) { + Debug::dump($path, $translation); $this->path = $path; $this->translation = ($translation === null) ? $path : $translation; - $this->search = ($translation === null) ? $path : $this->compile(); + $this->search = ($translation == stripslashes($path)) ? $translation : $this->compile(); } protected function compile()