Skip to content

Commit 92e5ba8

Browse files
authored
Merge pull request #27 from stein189/v2.0.2
V2.0.2
2 parents 71cb38d + de70919 commit 92e5ba8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/RouteFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function create($url, $method, $action)
7979
private function parseUrl($url)
8080
{
8181
$newUrl = preg_replace($this->patterns, $this->replacements, $url);
82+
$newUrl = trim($newUrl, '\/?');
8283
$newUrl = trim($newUrl, '\/');
8384

8485
return $newUrl;
@@ -91,7 +92,7 @@ private function parseUrl($url)
9192
*/
9293
private function parseArguments($url)
9394
{
94-
preg_match_all('~{(n:|a:|an:|w:|\*:|\?:)?([a-zA-Z0-9]+)}~', $url, $matches);
95+
preg_match_all('~{(n:|a:|an:|w:|\*:|\?:)?([a-zA-Z0-9_]+)}~', $url, $matches);
9596

9697
if (isset($matches[2]) && !empty($matches[2])) {
9798
return $matches[2];

0 commit comments

Comments
 (0)