From 8781e52ab5ee207ea1f5413ce41fe3d57fcbc899 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 8 Aug 2011 23:53:00 -0500 Subject: [PATCH] added support for periods in (:any) place-holder. --- system/routing/router.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/routing/router.php b/system/routing/router.php index d8b3fa43..b41ac436 100644 --- a/system/routing/router.php +++ b/system/routing/router.php @@ -92,11 +92,11 @@ private function translate_wildcards($key) // For optional parameters, first translate the wildcards to their // regex equivalent, sans the ")?" ending. We will add the endings // 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) : ''; - 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); } /**