From 3a4cfed687f4baa395c1680abee26c07c60c005b Mon Sep 17 00:00:00 2001 From: jozefcuryllo Date: Sat, 3 Mar 2018 18:11:08 +0100 Subject: [PATCH 1/3] Correct regex --- src/Route.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Route.php b/src/Route.php index 16bf99e..2edb15c 100755 --- a/src/Route.php +++ b/src/Route.php @@ -169,7 +169,7 @@ private function substituteFilter($matches) private function validateFilters() { foreach($this->filters as $key => $reg) { - if(!preg_match('~^:([[a-z]])$~i', $key)) { + if(!preg_match('/^:([a-z]+)/i', $key)) { throw new Exception('Invalid filter name `'.$key.'` it should contains only letters and start with `:`'); } } From 00dd727d8c0f2c0d68b732a905c97d22f4bd9a05 Mon Sep 17 00:00:00 2001 From: jozefcuryllo Date: Tue, 7 Apr 2020 01:51:18 +0200 Subject: [PATCH 2/3] Fix regex --- src/Router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Router.php b/src/Router.php index e9bd478..ce59a17 100755 --- a/src/Router.php +++ b/src/Router.php @@ -121,7 +121,7 @@ public function match($requestUrl, $requestMethod = RequestMethodInterface::METH $params = array(); - if (preg_match_all('/:([\w-%]+)/', $routes->getUrl(), $argument_keys)) { + if (preg_match_all('/:([\w\-\%]+)/', $routes->getUrl(), $argument_keys)) { // grab array with matches $argument_keys = $argument_keys[1]; From 5df7b473464022da00aeea1e768d57fc7d972d15 Mon Sep 17 00:00:00 2001 From: jozefcuryllo Date: Tue, 7 Apr 2020 01:52:13 +0200 Subject: [PATCH 3/3] Fix regex --- src/Route.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Route.php b/src/Route.php index 2edb15c..721e28c 100755 --- a/src/Route.php +++ b/src/Route.php @@ -154,7 +154,7 @@ private function substituteFilter($matches) return $this->filters[$matches[1]]; } - return '([\w-%]+)'; + return '([\w\-\%]+)'; } /**