File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 3
3
$ container ->loadFromExtension ('framework ' , array (
4
4
'secret ' => 's3cr3t ' ,
5
5
'default_locale ' => 'fr ' ,
6
- 'form ' => null ,
6
+ 'form ' => array (
7
+ 'csrf_protection ' => array (
8
+ 'field_name ' => '_csrf ' ,
9
+ ),
10
+ ),
7
11
'http_method_override ' => false ,
8
12
'trusted_proxies ' => array ('127.0.0.1 ' , '10.0.0.1 ' ),
9
13
'csrf_protection ' => array (
10
14
'enabled ' => true ,
11
- 'field_name ' => '_csrf ' ,
12
15
),
13
16
'esi ' => array (
14
17
'enabled ' => true ,
Original file line number Diff line number Diff line change 7
7
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
8
8
9
9
<framework : config secret =" s3cr3t" ide =" file%%link%%format" default-locale =" fr" trusted-proxies =" 127.0.0.1, 10.0.0.1" http-method-override =" false" >
10
- <framework : csrf-protection enabled =" true" field-name =" _csrf" />
11
- <framework : form />
10
+ <framework : csrf-protection enabled =" true" />
11
+ <framework : form >
12
+ <framework : csrf-protection field-name =" _csrf" />
13
+ </framework : form >
12
14
<framework : esi enabled =" true" />
13
15
<framework : profiler only-exceptions =" true" enabled =" false" />
14
16
<framework : router resource =" %kernel.root_dir%/config/routing.xml" type =" xml" />
Original file line number Diff line number Diff line change 1
1
framework :
2
2
secret : s3cr3t
3
3
default_locale : fr
4
- form : ~
4
+ form :
5
+ csrf_protection :
6
+ field_name : _csrf
5
7
http_method_override : false
6
8
trusted_proxies : ['127.0.0.1', '10.0.0.1']
7
9
csrf_protection :
8
10
enabled : true
9
- field_name : _csrf
10
11
esi :
11
12
enabled : true
12
13
profiler :
Original file line number Diff line number Diff line change @@ -486,8 +486,10 @@ public function testFormsCanBeEnabledWithoutCsrfProtection()
486
486
$ this ->assertFalse ($ container ->getParameter ('form.type_extension.csrf.enabled ' ));
487
487
}
488
488
489
- public function testFormCsrfFieldNameCanBeSetUnderCsrfSettings ()
489
+ public function testLegacyFormCsrfFieldNameCanBeSetUnderCsrfSettings ()
490
490
{
491
+ $ this ->iniSet ('error_reporting ' , -1 & ~E_USER_DEPRECATED );
492
+
491
493
$ container = $ this ->createContainerFromFile ('form_csrf_sets_field_name ' );
492
494
493
495
$ this ->assertTrue ($ container ->getParameter ('form.type_extension.csrf.enabled ' ));
You can’t perform that action at this time.
0 commit comments