Compare commits

..

4 Commits

Author SHA1 Message Date
Simon Sessingø f2fd5261c1 Merge pull request #34 from skipperbent/development
[BUGFIX] Fixed parameters on custom regex match.
2015-11-21 20:34:45 +01:00
Simon Sessingø 02de9572fa [BUGFIX] Fixed parameters on custom regex match. 2015-11-21 20:31:44 +01:00
Simon Sessingø e2a618fadd Merge pull request #33 from skipperbent/development
[BUGFIX] Fixed optinal parameters not availible when getting route.
2015-11-21 19:44:19 +01:00
Simon Sessingø e5700477e0 [BUGFIX] Fixed optinal parameters not availible when getting route.
[BUGFIX] Fixed optinal parameters not availible in url.
2015-11-21 19:43:23 +01:00
+3 -3
View File
@@ -6,7 +6,7 @@ use Pecee\Http\Request;
class RouterRoute extends RouterEntry {
const PARAMETERS_REGEX_MATCH = '{([A-Za-z\-\_]*?)}';
const PARAMETERS_REGEX_MATCH = '{([A-Za-z\-\_]*?\?{0,1})}';
protected $url;
@@ -26,8 +26,8 @@ class RouterRoute extends RouterEntry {
// Match on custom defined regular expression
if($this->regexMatch) {
$parameters = array();
if(preg_match('/'.$this->regexMatch.'/is', $url, $parameters)) {
$this->parameters = $parameters[0];
if(preg_match('/('.$this->regexMatch.')/is', $url, $parameters)) {
$this->parameters = (!is_array($parameters[0]) ? array($parameters[0]) : $parameters[0]);
return $this;
}
}