Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
bug #1534 RedirectableUrlMatcher needs to return a proper array with …
Browse files Browse the repository at this point in the history
…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
-------

e6d41b8 RedirectableUrlMatcher needs to return a proper array with the _route parameter
  • Loading branch information
fabpot committed Jun 15, 2017
2 parents 56dfd32 + e6d41b8 commit 268e3d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Silex/Provider/Routing/RedirectableUrlMatcher.php
Expand Up @@ -48,6 +48,7 @@ public function redirect($path, $route, $scheme = null)

return array(
'_controller' => function ($url) { return new RedirectResponse($url, 301); },
'_route' => $route,
'url' => $url,
);
}
Expand Down

0 comments on commit 268e3d3

Please sign in to comment.