File tree Expand file tree Collapse file tree 3 files changed +60
-3
lines changed
Tests/DependencyInjection Expand file tree Collapse file tree 3 files changed +60
-3
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,16 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
461
461
->children ()
462
462
->scalarNode ('storage_id ' )->defaultValue ('session.storage.native ' )->end ()
463
463
->scalarNode ('handler_id ' )->defaultValue ('session.handler.native_file ' )->end ()
464
- ->scalarNode ('name ' )->end ()
464
+ ->scalarNode ('name ' )
465
+ ->validate ()
466
+ ->ifTrue (function ($ v ) {
467
+ parse_str ($ v , $ parsed );
468
+
469
+ return implode ('& ' , array_keys ($ parsed )) !== (string ) $ v ;
470
+ })
471
+ ->thenInvalid ('Session name %s contains illegal character(s) ' )
472
+ ->end ()
473
+ ->end ()
465
474
->scalarNode ('cookie_lifetime ' )->end ()
466
475
->scalarNode ('cookie_path ' )->end ()
467
476
->scalarNode ('cookie_domain ' )->end ()
Original file line number Diff line number Diff line change @@ -79,6 +79,55 @@ public function testTrustedProxiesSetToNonEmptyArrayIsInvalid()
79
79
80
80
/**
81
81
* @group legacy
82
+ * @dataProvider getTestValidSessionName
83
+ */
84
+ public function testValidSessionName ($ sessionName )
85
+ {
86
+ $ processor = new Processor ();
87
+ $ config = $ processor ->processConfiguration (
88
+ new Configuration (true ),
89
+ array (array ('session ' => array ('name ' => $ sessionName )))
90
+ );
91
+
92
+ $ this ->assertEquals ($ sessionName , $ config ['session ' ]['name ' ]);
93
+ }
94
+
95
+ public function getTestValidSessionName ()
96
+ {
97
+ return array (
98
+ array (null ),
99
+ array ('PHPSESSID ' ),
100
+ array ('a&b ' ),
101
+ array (',_-!@#$%^*(){}:<>/? ' ),
102
+ );
103
+ }
104
+
105
+ /**
106
+ * @dataProvider getTestInvalidSessionName
107
+ * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
108
+ */
109
+ public function testInvalidSessionName ($ sessionName )
110
+ {
111
+ $ processor = new Processor ();
112
+ $ processor ->processConfiguration (
113
+ new Configuration (true ),
114
+ array (array ('session ' => array ('name ' => $ sessionName )))
115
+ );
116
+ }
117
+
118
+ public function getTestInvalidSessionName ()
119
+ {
120
+ return array (
121
+ array ('a.b ' ),
122
+ array ('a[ ' ),
123
+ array ('a[] ' ),
124
+ array ('a[b] ' ),
125
+ array ('a=b ' ),
126
+ array ('a+b ' ),
127
+ );
128
+ }
129
+
130
+ /**
82
131
* @dataProvider getTestValidTrustedProxiesData
83
132
*/
84
133
public function testValidTrustedProxies ($ trustedProxies , $ processedProxies )
Original file line number Diff line number Diff line change 39
39
"symfony/css-selector" : " ~2.8|~3.0|~4.0" ,
40
40
"symfony/dom-crawler" : " ~2.8|~3.0|~4.0" ,
41
41
"symfony/polyfill-intl-icu" : " ~1.0" ,
42
- "symfony/security" : " ~2.8|~3.0|~4.0" ,
43
42
"symfony/form" : " ~3.4|~4.0" ,
44
43
"symfony/expression-language" : " ~2.8|~3.0|~4.0" ,
45
44
"symfony/process" : " ~2.8|~3.0|~4.0" ,
46
45
"symfony/security-core" : " ~3.2|~4.0" ,
47
- "symfony/security-csrf" : " ~ 2.8|~3.0 |~4.0" ,
46
+ "symfony/security-csrf" : " ^ 2.8.31|^3.3.13 |~4.0" ,
48
47
"symfony/serializer" : " ~3.3|~4.0" ,
49
48
"symfony/stopwatch" : " ~3.4|~4.0" ,
50
49
"symfony/translation" : " ~3.4|~4.0" ,
You can’t perform that action at this time.
0 commit comments