@@ -18,6 +18,7 @@ final class RedisStorage implements Storage
1818{
1919
2020 private const NS_NETTE = 'Contributte.Storage ' ;
21+ private const NS_SEPARATOR = "\x00" ;
2122
2223 private const META_TIME = 'time ' ; // timestamp
2324 private const META_EXPIRE = 'expire ' ; // expiration timestamp
@@ -159,7 +160,7 @@ public function write($key, $data, array $dependencies): void
159160 }
160161
161162 $ data = $ this ->serializer ->serialize ($ data , $ meta );
162- $ store = json_encode ($ meta ) . Cache:: NAMESPACE_SEPARATOR . $ data ;
163+ $ store = json_encode ($ meta ) . self :: NS_SEPARATOR . $ data ;
163164
164165 try {
165166 if (isset ($ dependencies [Cache::EXPIRATION ])) {
@@ -209,7 +210,7 @@ public function clean(array $conditions): void
209210
210211 private function formatEntryKey (string $ key ): string
211212 {
212- return self ::NS_NETTE . ': ' . str_replace (Cache:: NAMESPACE_SEPARATOR , ': ' , $ key );
213+ return self ::NS_NETTE . ': ' . str_replace (self :: NS_SEPARATOR , ': ' , $ key );
213214 }
214215
215216
@@ -312,7 +313,7 @@ private function doMultiRead(array $keys): array
312313 */
313314 private static function processStoredValue (string $ key , string $ storedValue ): array
314315 {
315- [$ meta , $ data ] = explode (Cache:: NAMESPACE_SEPARATOR , $ storedValue , 2 ) + [null , null ];
316+ [$ meta , $ data ] = explode (self :: NS_SEPARATOR , $ storedValue , 2 ) + [null , null ];
316317 return [[self ::KEY => $ key ] + json_decode ((string ) $ meta , true ), $ data ];
317318 }
318319
0 commit comments