Commit 727932da authored by Fabien Potencier's avatar Fabien Potencier

merged branch GromNaN/null-controller (PR #775)

This PR was merged into the master branch.

Discussion
----------

[Security] Make fake routes dumpable by setting NULL as controller

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #774
| License       | MIT

By setting `NULL` as controller, the route will end in 404 error if it's not bypassed by a security listener.

Commits
-------

5e2c4b62 Use null controller as fake route to be dumpable
parents e7d4a2fd 5e2c4b62
...@@ -541,7 +541,7 @@ class SecurityServiceProvider implements ServiceProviderInterface ...@@ -541,7 +541,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
foreach ($this->fakeRoutes as $route) { foreach ($this->fakeRoutes as $route) {
list($method, $pattern, $name) = $route; list($method, $pattern, $name) = $route;
$app->$method($pattern, function() {})->bind($name); $app->$method($pattern, null)->bind($name);
} }
} }
......
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