@@ -29,6 +29,7 @@ class RedisStorage implements \Kdyby\Redis\IMultiReadStorage
29
29
* @internal
30
30
*/
31
31
private const NS_NETTE = 'Nette.Storage ' ;
32
+ private const NAMESPACE_SEPARATOR = "\x00" ;
32
33
33
34
/**
34
35
* cache meta structure: array of
@@ -215,7 +216,7 @@ public function write(string $key, $data, array $dp): void
215
216
$ meta [self ::META_SERIALIZED ] = TRUE ;
216
217
}
217
218
218
- $ store = \json_encode ($ meta ) . Cache ::NAMESPACE_SEPARATOR . $ data ;
219
+ $ store = \json_encode ($ meta ) . self ::NAMESPACE_SEPARATOR . $ data ;
219
220
220
221
try {
221
222
if (isset ($ dp [Cache::EXPIRATION ])) {
@@ -275,7 +276,7 @@ public function clean(array $conds): void
275
276
276
277
protected function formatEntryKey (string $ key ): string
277
278
{
278
- return self ::NS_NETTE . ': ' . \str_replace (Cache ::NAMESPACE_SEPARATOR , ': ' , $ key );
279
+ return self ::NS_NETTE . ': ' . \str_replace (self ::NAMESPACE_SEPARATOR , ': ' , $ key );
279
280
}
280
281
281
282
/**
@@ -334,7 +335,7 @@ private function doMultiRead(array $keys): array
334
335
*/
335
336
private static function processStoredValue (string $ key , string $ storedValue ): array
336
337
{
337
- [$ meta , $ data ] = \explode (Cache ::NAMESPACE_SEPARATOR , $ storedValue , 2 ) + [NULL , NULL ];
338
+ [$ meta , $ data ] = \explode (self ::NAMESPACE_SEPARATOR , $ storedValue , 2 ) + [NULL , NULL ];
338
339
return [[self ::KEY => $ key ] + \json_decode ($ meta , TRUE ), $ data ];
339
340
}
340
341
0 commit comments