From 4adbab1463fa510a0c6e12940219953a31935b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Englick=C3=BD?= Date: Wed, 8 Jun 2022 09:31:55 +0200 Subject: [PATCH] Fix compatibility with Nette/Caching v3.1.3 (#187) --- src/Caching/PhpFileStorage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Caching/PhpFileStorage.php b/src/Caching/PhpFileStorage.php index c1833e6e..f1afd03d 100644 --- a/src/Caching/PhpFileStorage.php +++ b/src/Caching/PhpFileStorage.php @@ -29,6 +29,8 @@ class PhpFileStorage extends \Nette\Caching\Storages\FileStorage implements \Net private const FILE = 'file'; private const HANDLE = 'handle'; + private const NS_SEPARATOR = "\x00"; + /** * Reads cache data from disk. * @@ -54,7 +56,7 @@ protected function getCacheFile(string $key): string $cacheKey = substr_replace( $key, trim(strtr($this->hint, '\\/@', '.._'), '.') . '-', - strpos($key, Cache::NAMESPACE_SEPARATOR) + 1, + strpos($key, self::NS_SEPARATOR) + 1, 0 );