route: catch the regex syntax error correctely
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3731 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -488,7 +488,13 @@ class route
|
|||||||
else
|
else
|
||||||
$regex = str_replace ("}", ">[^/]+)", $regex);
|
$regex = str_replace ("}", ">[^/]+)", $regex);
|
||||||
unset ($matches);
|
unset ($matches);
|
||||||
$rcRegex = preg_match ($regex, $url, $matches);
|
$rcRegex = @preg_match ($regex, $url, $matches);
|
||||||
|
if ($rcRegex === false)
|
||||||
|
{
|
||||||
|
if (count (error_get_last()))
|
||||||
|
throw new \Exception ("Invalid regex provided: $regex : ".
|
||||||
|
error_get_last()["message"], 500);
|
||||||
|
}
|
||||||
if ($rcRegex !== FALSE && $rcRegex !== 0)
|
if ($rcRegex !== FALSE && $rcRegex !== 0)
|
||||||
{
|
{
|
||||||
if ($this->debug)
|
if ($this->debug)
|
||||||
|
|||||||
Reference in New Issue
Block a user