[FrameworkBundle] made csrf_secret parameter optional

This commit is contained in:
Fabien Potencier 2010-09-10 19:32:17 +02:00
parent 77602239a4
commit 74bc9d461b

View File

@ -26,8 +26,8 @@ class FrameworkBundle extends Bundle
*/
public function boot()
{
if ($secret = $this->container->getParameter('csrf_secret')) {
Form::setDefaultCsrfSecret($secret);
if ($this->container->hasParameter('csrf_secret')) {
Form::setDefaultCsrfSecret($this->container->getParameter('csrf_secret'));
Form::enableDefaultCsrfProtection();
}
}