Automatically enable the CSRF protection if CSRF manager exists

This commit is contained in:
Samuel ROZE 2017-11-24 15:22:02 +00:00
parent e83b82bf94
commit fd4340693c
No known key found for this signature in database
GPG Key ID: 835426F55A19FB84

View File

@ -21,6 +21,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Form\Form;
use Symfony\Component\Lock\Lock;
use Symfony\Component\Lock\Store\SemaphoreStore;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Validator\Validation;
@ -142,7 +143,7 @@ class Configuration implements ConfigurationInterface
$rootNode
->children()
->arrayNode('csrf_protection')
->canBeEnabled()
->{!class_exists(FullStack::class) && class_exists(CsrfTokenManagerInterface::class) ? 'canBeDisabled' : 'canBeEnabled'}()
->end()
->end()
;