[Routing] Small optimization in the UrlMatcher
This commit is contained in:
parent
abc2141d5b
commit
4fcf9efe65
@ -80,7 +80,7 @@ class UrlMatcher implements UrlMatcherInterface
|
|||||||
{
|
{
|
||||||
$this->allow = array();
|
$this->allow = array();
|
||||||
|
|
||||||
if ($ret = $this->matchCollection($pathinfo, $this->routes)) {
|
if ($ret = $this->matchCollection(urldecode($pathinfo), $this->routes)) {
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,8 +102,6 @@ class UrlMatcher implements UrlMatcherInterface
|
|||||||
*/
|
*/
|
||||||
protected function matchCollection($pathinfo, RouteCollection $routes)
|
protected function matchCollection($pathinfo, RouteCollection $routes)
|
||||||
{
|
{
|
||||||
$pathinfo = urldecode($pathinfo);
|
|
||||||
|
|
||||||
foreach ($routes as $name => $route) {
|
foreach ($routes as $name => $route) {
|
||||||
if ($route instanceof RouteCollection) {
|
if ($route instanceof RouteCollection) {
|
||||||
if (false === strpos($route->getPrefix(), '{') && $route->getPrefix() !== substr($pathinfo, 0, strlen($route->getPrefix()))) {
|
if (false === strpos($route->getPrefix(), '{') && $route->getPrefix() !== substr($pathinfo, 0, strlen($route->getPrefix()))) {
|
||||||
|
Reference in New Issue
Block a user