Properly handle the allow_slash parameter for regexes that have one or more end-of-string characters.

develop
Sven Slootweg 12 years ago
parent f4f15d9cd1
commit e864e912d0

@ -62,9 +62,16 @@ class CPHPRouter extends CPHPBaseClass
if($found === false)
{
if($this->allow_slash === true)
{
if(strpos($route_regex, "$") !== false)
{
$route_regex = str_replace("$", "/?$", $route_regex);
}
else
{
$route_regex = "{$route_regex}/?";
}
}
$regex = str_replace("/", "\/", $route_regex);
if(preg_match("/{$regex}/i", $requestpath, $matches))

Loading…
Cancel
Save