File tree Expand file tree Collapse file tree 1 file changed +31
-5
lines changed Expand file tree Collapse file tree 1 file changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,38 @@ Configuring CSRF Protection
1919First, make sure that the CSRF protection is enabled in the main cofiguration
2020file:
2121
22- .. code-block :: yaml
22+ .. configuration-block ::
23+
24+ .. code-block :: yaml
25+
26+ # app/config/config.yml
27+ framework :
28+ # ...
29+ csrf_protection : ~
30+
31+ .. code-block :: xml
2332
24- # app/config/config.yml
25- framework :
26- # ...
27- csrf_protection : ~
33+ <!-- app/config/config.xml -->
34+ <?xml version =" 1.0" encoding =" UTF-8" ?>
35+ <container xmlns =" http://symfony.com/schema/dic/services"
36+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
37+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
38+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
39+ http://symfony.com/schema/dic/services/services-1.0.xsd
40+ http://symfony.com/schema/dic/symfony
41+ http://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
42+
43+ <framework : config >
44+ <framework : csrf-protection enabled =" true" />
45+ </framework : config >
46+ </container >
47+
48+ .. code-block :: php
49+
50+ // app/config/config.php
51+ $container->loadFromExtension('framework', array(
52+ 'csrf_protection' => null,
53+ ));
2854
2955 Then, the security component needs a CSRF token provider. You can set this to
3056use the default provider available in the security component:
You can’t perform that action at this time.
0 commit comments