File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,14 @@ protected function doFetch(array $ids)
60
60
$ unserializeCallbackHandler = ini_set ('unserialize_callback_func ' , __CLASS__ .'::handleUnserializeCallback ' );
61
61
try {
62
62
$ values = [];
63
- foreach (apcu_fetch ($ ids , $ ok ) ?: [] as $ k => $ v ) {
63
+ $ ids = array_flip ($ ids );
64
+ foreach (apcu_fetch (array_keys ($ ids ), $ ok ) ?: [] as $ k => $ v ) {
65
+ if (!isset ($ ids [$ k ])) {
66
+ // work around https://github.com/krakjoe/apcu/issues/247
67
+ $ k = key ($ ids );
68
+ }
69
+ unset($ ids [$ k ]);
70
+
64
71
if (null !== $ v || $ ok ) {
65
72
$ values [$ k ] = null !== $ this ->marshaller ? $ this ->marshaller ->unmarshall ($ v ) : $ v ;
66
73
}
Original file line number Diff line number Diff line change @@ -306,6 +306,15 @@ public function testWeirdDataMatchingMetadataWrappedValues()
306
306
307
307
$ this ->assertTrue ($ cache ->hasItem ('foobar ' ));
308
308
}
309
+
310
+ public function testNullByteInKey ()
311
+ {
312
+ $ cache = $ this ->createCachePool (0 , __FUNCTION__ );
313
+
314
+ $ cache ->save ($ cache ->getItem ("a \0b " )->set (123 ));
315
+
316
+ $ this ->assertSame (123 , $ cache ->getItem ("a \0b " )->get ());
317
+ }
309
318
}
310
319
311
320
class NotUnserializable
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ protected function filterFiles(array $files)
192
192
/**
193
193
* {@inheritdoc}
194
194
*
195
- * @param Request $request
195
+ * @param Response $response
196
196
*
197
197
* @return DomResponse
198
198
*/
Original file line number Diff line number Diff line change @@ -96,6 +96,9 @@ public function testFindWithExtraDirs()
96
96
$ this ->assertSamePath (\PHP_BINARY , $ result );
97
97
}
98
98
99
+ /**
100
+ * @runInSeparateProcess
101
+ */
99
102
public function testFindWithOpenBaseDir ()
100
103
{
101
104
if ('\\' === \DIRECTORY_SEPARATOR ) {
@@ -114,6 +117,9 @@ public function testFindWithOpenBaseDir()
114
117
$ this ->assertSamePath (\PHP_BINARY , $ result );
115
118
}
116
119
120
+ /**
121
+ * @runInSeparateProcess
122
+ */
117
123
public function testFindProcessInOpenBasedir ()
118
124
{
119
125
if (ini_get ('open_basedir ' )) {
You can’t perform that action at this time.
0 commit comments