diff --git a/route.php b/route.php index 937e519..e52835b 100644 --- a/route.php +++ b/route.php @@ -488,7 +488,13 @@ class route else $regex = str_replace ("}", ">[^/]+)", $regex); 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 ($this->debug)