File tree 1 file changed +8
-6
lines changed
src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -106,19 +106,21 @@ public function testWithLazySavePathConnection()
106
106
@unlink ($ dbFile );
107
107
}
108
108
109
- public function testReadWriteRead ()
109
+ public function testReadWriteReadWithNullByte ()
110
110
{
111
+ $ sessionData = 'da ' . "\0" . 'ta ' ;
112
+
111
113
$ storage = new PdoSessionHandler ($ this ->pdo );
112
114
$ storage ->open ('' , 'sid ' );
113
- $ data = $ storage ->read ('id ' );
114
- $ storage ->write ('id ' , ' data ' );
115
+ $ readData = $ storage ->read ('id ' );
116
+ $ storage ->write ('id ' , $ sessionData );
115
117
$ storage ->close ();
116
- $ this ->assertSame ('' , $ data , 'New session returns empty string data ' );
118
+ $ this ->assertSame ('' , $ readData , 'New session returns empty string data ' );
117
119
118
120
$ storage ->open ('' , 'sid ' );
119
- $ data = $ storage ->read ('id ' );
121
+ $ readData = $ storage ->read ('id ' );
120
122
$ storage ->close ();
121
- $ this ->assertSame (' data ' , $ data , 'Written value can be read back correctly ' );
123
+ $ this ->assertSame ($ sessionData , $ readData , 'Written value can be read back correctly ' );
122
124
}
123
125
124
126
/**
You can’t perform that action at this time.
0 commit comments