Corrected root page bug
This commit is contained in:
parent
22371daae7
commit
11d0aa2c7a
13
Route.php
13
Route.php
|
@ -41,7 +41,12 @@ class Route{
|
|||
|
||||
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
|
||||
$route['expression'] = $route['expression'].'$';
|
||||
|
||||
//echo $route['expression'].'<br/>';
|
||||
|
||||
//check match
|
||||
if(preg_match('#'.$route['expression'].'#',self::$path,$matches)){
|
||||
|
||||
//echo $expression;
|
||||
|
||||
|
||||
array_shift($matches);//Always remove first element. This contains the whole string
|
||||
|
||||
if(Config::get('basepath')){
|
||||
|
|
Loading…
Reference in New Issue
Block a user