Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Guarding against null values before unserializing. This addresses E_D…
…EPRECATED notices in PHP 8.2 when unserializing as it the function signature now only accepts string values.
  • Loading branch information
brentscheffler committed Oct 20, 2023
commit cddca5cfa3c87dbccb83c095bc99ee94a462206b
6 changes: 4 additions & 2 deletions src/Adapter/Predis/PredisCachePool.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ public function __construct(Client $cache)
*/
protected function fetchObjectFromCache($key)
{
if (false === $result = unserialize($this->cache->get($this->getHierarchyKey($key)))) {
$result = $this->cache->get($this->getHierarchyKey($key));

if (false === $result || null === $result) {
return [false, null, [], null];
}

return $result;
return unserialize($result);
}

/**
Expand Down