Corrected root page bug

This commit is contained in:
SteamPixel 2016-05-16 17:41:04 +01:00
parent 22371daae7
commit 11d0aa2c7a

View File

@ -41,7 +41,12 @@ class Route{
if(Config::get('basepath')){ if(Config::get('basepath')){
$route['expression'] = '('.Config::get('basepath').')/'.$route['expression']; //Add / if its not empty
if($route['expression']!=''){
$route['expression'] = '/'.$route['expression'];
}
$route['expression'] = '('.Config::get('basepath').')'.$route['expression'];
} }
@ -51,11 +56,11 @@ class Route{
//Add 'find string end' automatically //Add 'find string end' automatically
$route['expression'] = $route['expression'].'$'; $route['expression'] = $route['expression'].'$';
//echo $route['expression'].'<br/>';
//check match //check match
if(preg_match('#'.$route['expression'].'#',self::$path,$matches)){ if(preg_match('#'.$route['expression'].'#',self::$path,$matches)){
//echo $expression;
array_shift($matches);//Always remove first element. This contains the whole string array_shift($matches);//Always remove first element. This contains the whole string
if(Config::get('basepath')){ if(Config::get('basepath')){