Skip to content

Commit f2fd526

Browse files
committed
Merge pull request #34 from skipperbent/development
[BUGFIX] Fixed parameters on custom regex match.
2 parents e2a618f + 02de957 commit f2fd526

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Pecee/SimpleRouter/RouterRoute.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public function matchRoute(Request $request) {
2626
// Match on custom defined regular expression
2727
if($this->regexMatch) {
2828
$parameters = array();
29-
if(preg_match('/'.$this->regexMatch.'/is', $url, $parameters)) {
30-
$this->parameters = $parameters[0];
29+
if(preg_match('/('.$this->regexMatch.')/is', $url, $parameters)) {
30+
$this->parameters = (!is_array($parameters[0]) ? array($parameters[0]) : $parameters[0]);
3131
return $this;
3232
}
3333
}

0 commit comments

Comments
 (0)