From 79c1d7d0f04cb7fba84b6892c28c08f41e189401 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 15 May 2013 11:47:46 +0200 Subject: [PATCH] // refacto for last commit c7aa92f3b3ddb3bc18247f5b2c61fbf6b36185cf --- classes/Dispatcher.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/Dispatcher.php b/classes/Dispatcher.php index 299e6e177..d359258cf 100644 --- a/classes/Dispatcher.php +++ b/classes/Dispatcher.php @@ -670,7 +670,7 @@ class DispatcherCore $controller = false; // Use routes ? (for url rewriting) - if ($this->use_routes && !$controller) + if ($this->use_routes && !$controller && !defined('_PS_ADMIN_DIR_')) { if (!$this->request_uri) return strtolower($this->controller_not_found); @@ -711,8 +711,7 @@ class DispatcherCore } } - $request_uri = str_replace(str_replace(realpath(dirname(_PS_ADMIN_DIR_)), '', _PS_ADMIN_DIR_).DIRECTORY_SEPARATOR, '', $this->request_uri); - if (in_array($controller, array('index', 'adminnotfound')) || in_array($request_uri, array('', 'index', 'index.php'))) + if ($controller == 'index' || $this->request_uri == '/index.php') $controller = $this->default_controller; $this->controller = $controller; }