1
0
mirror of https://github.com/dannyvankooten/AltoRouter.git synced 2025-08-11 02:44:03 +02:00

escape dash to fix tests

This commit is contained in:
Koen Punt
2014-05-10 14:56:15 +02:00
parent aa0706284d
commit 99f75c28e6
2 changed files with 3 additions and 2 deletions

View File

@@ -186,7 +186,8 @@ class AltoRouter {
if ($_route === '*') {
$match = true;
} elseif (isset($_route[0]) && $_route[0] === '@') {
$match = preg_match('`' . substr($_route, 1) . '`u', $requestUrl, $params);
$pattern = '`' . substr($_route, 1) . '`u';
$match = preg_match($pattern, $requestUrl, $params);
} else {
$route = null;
$regex = false;