Hello,
I get the following warning: preg_replace() [function.preg-replace]: Empty regular expression in ...... on line 32
line 32
$route= $path[0];
My code is
$path = array_keys($_GET);
$config = loader::load("config");
if (!isset($path[0]))
{
$default_controller = $config->default_controller;
if (!empty($default_controller))
$path[0] = $default_controller;
else
$path[0] = "index";
}
$route= $path[0];
$sanitzing_pattern = $config->allowed_url_chars;
$route = preg_replace($sanitzing_pattern, "", $route);
$route = str_replace("^","",$route);
$this->route = $route;
$routeParts = split( "/",$route);
$this->controller=$routeParts[0];
$this->action=isset($routeParts[1])? $routeParts[1]:"base";
array_shift($routeParts);
array_shift($routeParts);
$this->params=$routeParts;
Any idea?