diff --git a/src/SuperCacheManager.php b/src/SuperCacheManager.php index 660c116..4d3466f 100644 --- a/src/SuperCacheManager.php +++ b/src/SuperCacheManager.php @@ -167,7 +167,7 @@ public function get(string $key, ?string $connection_name = null, bool $isWithTa public function forget(string $key, ?string $connection_name = null, bool $isFinalKey = false, bool $isWithTags = false, bool $onlyTags = false): void { if ($isFinalKey) { - $finalKey = $key; + $finalKey = str_replace(['{', '}'], '', $key); } else { $finalKey = $this->getFinalKey($key, $isWithTags); } @@ -292,12 +292,12 @@ public function flush(?string $connection_name = null): void public function has(string $key, ?string $connection_name = null, bool $isWithTags = false, bool $isfinalKey = false): bool { if ($isfinalKey) { - $finalKey = $key; + $finalKey = str_replace(['{', '}'], '', $key); } else { - $finalKey = '{' . $this->getFinalKey($key, $isWithTags) . '}'; + $finalKey = $this->getFinalKey($key, $isWithTags); } - return $this->redis->getRedisConnection($connection_name)->exists($finalKey) > 0; + return $this->redis->getRedisConnection($connection_name)->exists('{' . $finalKey . '}') > 0; } /**