From dc49a4aaebb6b9e079693c4a8a3916ae61eaed72 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 18 Jul 2011 06:17:21 -0700 Subject: [PATCH] Simplify router code. --- system/router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/router.php b/system/router.php index 858753dd..86afe442 100644 --- a/system/router.php +++ b/system/router.php @@ -92,7 +92,7 @@ class Router { // Now, to properly close the regular expression, we need to append a ")?" for each optional segment in the route. if ($replacements > 0) { - $key .= implode('', array_fill(0, $replacements, ')?')); + $key .= str_repeat(')?', $replacements); } return str_replace(array(':num', ':any'), array('[0-9]+', '[a-zA-Z0-9\-_]+'), $key);