Make sure parameter-modifier is found before parsing parameters.

This commit is contained in:
Simon Sessingø
2016-11-24 10:04:47 +01:00
parent 9418d54c8e
commit ff1f027bda
@@ -48,6 +48,9 @@ abstract class LoadableRoute extends Route implements ILoadableRoute
public function setUrl($url)
{
$this->url = ($url === '/') ? '/' : '/' . trim($url, '/') . '/';
if(strpos($this->url, $this->paramModifiers[0]) !== false) {
$regex = sprintf(static::PARAMETERS_REGEX_MATCH, $this->paramModifiers[0], $this->paramOptionalSymbol, $this->paramModifiers[1]);
if (preg_match_all('/' . $regex . '/is', $this->url, $matches)) {
@@ -60,6 +63,8 @@ abstract class LoadableRoute extends Route implements ILoadableRoute
}
}
return $this;
}