added 'u' flag for preg_match to match UTF-8 URIs.

This commit is contained in:
Mohammad Sadeghi 2012-09-24 16:39:28 +03:30
parent 9df9a5df04
commit 7647c3fcba
1 changed files with 1 additions and 3 deletions

View File

@ -76,7 +76,6 @@ class Router {
public static $patterns = array(
'(:num)' => '([0-9]+)',
'(:any)' => '([a-zA-Z0-9\.\-_%=]+)',
'(:segment)' => '([^/]+)',
'(:all)' => '(.*)',
);
@ -88,7 +87,6 @@ class Router {
public static $optional = array(
'/(:num?)' => '(?:/([0-9]+)',
'/(:any?)' => '(?:/([a-zA-Z0-9\.\-_%=]+)',
'/(:segment?)' => '(?:/([^/]+)',
'/(:all?)' => '(?:/(.*)',
);
@ -496,7 +494,7 @@ protected static function match($method, $uri)
// we just did before we started searching.
if (str_contains($route, '('))
{
$pattern = '#^'.static::wildcards($route).'$#';
$pattern = '#^'.static::wildcards($route).'$#u';
// If we get a match we'll return the route and slice off the first
// parameter match, as preg_match sets the first array item to the