- Fixed issue with parsing parameters on some occasion.
- Optimisations.
This commit is contained in:
Simon Sessingø
2017-11-27 02:03:12 +01:00
parent bdfc36ed5c
commit efd5159604
7 changed files with 33 additions and 26 deletions
+2 -2
View File
@@ -117,7 +117,7 @@ abstract class Route implements IRoute
// Ensures that hostnames/domains will work with parameters
$url = '/' . ltrim($url, '/');
if (preg_match_all('/' . $regex . '/u', $route, $parameters) !== 0) {
if (preg_match_all('/' . $regex . '/u', $route, $parameters) > 0) {
$urlParts = preg_split('/((\-?\/?)\{[^}]+\})/', rtrim($route, '/'));
@@ -155,7 +155,7 @@ abstract class Route implements IRoute
$urlRegex = preg_quote($route, '/');
}
if (preg_match(sprintf($this->urlRegex, $urlRegex), $url, $matches) === 1) {
if (preg_match(sprintf($this->urlRegex, $urlRegex), $url, $matches) > 0) {
$values = [];