Disable th usade of "-" on {pseudovariables}
This commit is contained in:
parent
4b1585fe6d
commit
81f2d4d665
@ -43,12 +43,12 @@ class Router {
|
|||||||
* callback - Contiene el callback en formato Namespace\Clase::Método.
|
* callback - Contiene el callback en formato Namespace\Clase::Método.
|
||||||
*/
|
*/
|
||||||
private static function parse($path, $callback) {
|
private static function parse($path, $callback) {
|
||||||
preg_match_all('/{([\w-]+)}/s', $path, $matches, PREG_PATTERN_ORDER);
|
preg_match_all('/{(\w+)}/s', $path, $matches, PREG_PATTERN_ORDER);
|
||||||
$paramNames = $matches[1];
|
$paramNames = $matches[1];
|
||||||
|
|
||||||
$path = preg_quote($path, '/');
|
$path = preg_quote($path, '/');
|
||||||
$path = preg_replace(
|
$path = preg_replace(
|
||||||
['/\\\{[\w-]+\\\}/s'],
|
['/\\\{\w+\\\}/s'],
|
||||||
['([^\/]+)'],
|
['([^\/]+)'],
|
||||||
$path);
|
$path);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user