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:
@@ -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;
|
||||
|
@@ -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 .= ']+)';
|
||||
|
Reference in New Issue
Block a user