Skip to content

Commit

Permalink
Removes remnant of escaped special characters.
Browse files Browse the repository at this point in the history
Before `urlFor` would return '/path/Hello\.Josh' for a pattern
'/path/(:foo\.:bar)' with parameters
`('foo' => 'Hello', 'bar' => 'Josh')`, when the expected return value
is '/path/Hello.Josh' (this test was introduced in commit cc722cc).
  • Loading branch information
shello authored and = committed Sep 27, 2013
1 parent e8d0be9 commit 6ddc948
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Slim/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ public function urlFor($name, $params = array())
}
$pattern = preg_replace($search, $params, $this->getNamedRoute($name)->getPattern());

//Remove remnants of unpopulated, trailing optional pattern segments
return preg_replace('#\(/?:.+\)|\(|\)#', '', $pattern);
//Remove remnants of unpopulated, trailing optional pattern segments, escaped special characters
return preg_replace('#\(/?:.+\)|\(|\)|\\\\#', '', $pattern);
}
/**
Expand Down

0 comments on commit 6ddc948

Please sign in to comment.