From a414bbfccb63baff631f27a425e144c3b94f0870 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 15 Aug 2011 10:42:57 -0500 Subject: [PATCH] Remove any unspecified optional parameters from URIs created from routes. --- system/url.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/url.php b/system/url.php index c3fc53a0..c7b0e6ed 100644 --- a/system/url.php +++ b/system/url.php @@ -79,6 +79,8 @@ public static function to_route($name, $parameters = array(), $https = false) $uri = preg_replace('/\(.+?\)/', $parameter, $uri, 1); } + $uri = str_replace(array('/(:any?)', '/(:num?)'), '', $uri); + return static::to($uri, $https); }