added support for periods in (:any) place-holder.

This commit is contained in:
Taylor Otwell 2011-08-08 23:53:00 -05:00
parent 7ebcdf57c5
commit 8781e52ab5
1 changed files with 2 additions and 2 deletions

View File

@ -92,11 +92,11 @@ private function translate_wildcards($key)
// For optional parameters, first translate the wildcards to their // For optional parameters, first translate the wildcards to their
// regex equivalent, sans the ")?" ending. We will add the endings // regex equivalent, sans the ")?" ending. We will add the endings
// back on after we know how many replacements we made. // back on after we know how many replacements we made.
$key = str_replace(array('/(:num?)', '/(:any?)'), array('(?:/([0-9]+)', '(?:/([a-zA-Z0-9\-_]+)'), $key, $replacements); $key = str_replace(array('/(:num?)', '/(:any?)'), array('(?:/([0-9]+)', '(?:/([a-zA-Z0-9\.\-_]+)'), $key, $replacements);
$key .= ($replacements > 0) ? str_repeat(')?', $replacements) : ''; $key .= ($replacements > 0) ? str_repeat(')?', $replacements) : '';
return str_replace(array(':num', ':any'), array('[0-9]+', '[a-zA-Z0-9\-_]+'), $key); return str_replace(array(':num', ':any'), array('[0-9]+', '[a-zA-Z0-9\.\-_]+'), $key);
} }
/** /**