Commit dc49a4aa authored by Taylor Otwell's avatar Taylor Otwell

Simplify router code.

parent 72658bd0
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment