1
0
mirror of https://github.com/dannyvankooten/AltoRouter.git synced 2025-07-30 21:20:20 +02:00

Merge pull request #78 from koenpunt/escape-dash

escape dash to fix tests
This commit is contained in:
Koen Punt
2014-05-10 14:58:06 +02:00
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;

View File

@@ -351,7 +351,7 @@ class AltoRouterTest extends PHPUnit_Framework_TestCase
$pattern .= '\x{FE70}-\x{FEFF}';
$pattern .= '\x{0750}-\x{077F}';
// Alphanumeric, /, _, - and space characters
$pattern .= 'a-zA-Z0-9\/_-\s';
$pattern .= 'a-zA-Z0-9\/_\-\s';
// 'ZERO WIDTH NON-JOINER'
$pattern .= '\x{200C}';
$pattern .= ']+)';