Commit 268e3d33 authored by Fabien Potencier's avatar Fabien Potencier

bug #1534 RedirectableUrlMatcher needs to return a proper array with the _route parameter (slipo)

This PR was merged into the 2.1.x-dev branch.

Discussion
----------

RedirectableUrlMatcher needs to return a proper array with the _route parameter

Symfony's HttpUtils's checkRequestPath() expects RedirectableUrlMatcher to return an array with '_route'. This throws a notice `Undefined index: _route`:

```
        $coll = new RouteCollection();
        $coll->add('foo', new Route('/foo', array(), array(), array(), '', array('https')));
        $matcher = new RedirectableUrlMatcher($coll, new RequestContext());
        $httpUtils = new HttpUtils(null, $matcher);
        $request = Request::create('http://example.com/foo');
        $httpUtils->checkRequestPath($request, 'foo');
```

It's an issue with my app although I haven't yet taken the time to make a simplified app to show the issue besides the above.

Commits
-------

e6d41b8d RedirectableUrlMatcher needs to return a proper array with the _route parameter
parents 56dfd325 e6d41b8d
...@@ -48,6 +48,7 @@ class RedirectableUrlMatcher extends BaseRedirectableUrlMatcher ...@@ -48,6 +48,7 @@ class RedirectableUrlMatcher extends BaseRedirectableUrlMatcher
return array( return array(
'_controller' => function ($url) { return new RedirectResponse($url, 301); }, '_controller' => function ($url) { return new RedirectResponse($url, 301); },
'_route' => $route,
'url' => $url, 'url' => $url,
); );
} }
......
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