mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Development
- Began work on new documentation. - BaseCsrfVerifier now only matches `POST`, `PUT` and `DELETE`. - Parameters are now parsed on custom regex-matches. - Added `$type` option to `get` method in `Input` class.
This commit is contained in:
@@ -19,8 +19,12 @@ class RouteUrl extends LoadableRoute
|
||||
// Match on custom defined regular expression
|
||||
if ($this->regex !== null) {
|
||||
$parameters = [];
|
||||
if (preg_match('/(' . $this->regex . ')/is', $request->getHost() . $url, $parameters)) {
|
||||
$this->parameters = (array)$parameters[0];
|
||||
if (preg_match($this->regex, $request->getHost() . $url, $parameters)) {
|
||||
/* Remove global match */
|
||||
if(count($parameters) > 1) {
|
||||
array_shift($parameters);
|
||||
$this->parameters = $parameters;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user