merged branch johannes85/2.0 (PR #3791)

Commits
-------

0024ddc Fix for using route name as check_path.

Discussion
----------

Security Bundle route as check_path

In the current 2.0 branch you can't use a route as
firewalls:
admin_area:
login_path:
you will get a InvalidConfigurationException.

In the 2.1 version this is fixed. Since 2.1 isn't released i think this fix should be merged into the 2.0 branch too. Many people have this problem (https://github.com/schmittjoh/JMSI18nRoutingBundle/issues/7) for example which effectively blocks internationalisation in combination with the firewall.

---------------------------------------------------------------------------

by stof at 2012-04-10T13:35:13Z

@fabpot ping
This commit is contained in:
Fabien Potencier 2012-04-10 20:26:31 +02:00
commit 57990cc53f

View File

@ -274,7 +274,7 @@ class MainConfiguration implements ConfigurationInterface
continue;
}
if (!preg_match('#'.$firewall['pattern'].'#', $firewall[$k]['check_path'])) {
if (false !== strpos('/', $firewall[$k]['check_path']) && !preg_match('#'.$firewall['pattern'].'#', $firewall[$k]['check_path'])) {
throw new \LogicException(sprintf('The check_path "%s" for login method "%s" is not matched by the firewall pattern "%s".', $firewall[$k]['check_path'], $k, $firewall['pattern']));
}
}