Skip to content

Commit f9c0966

Browse files
authored
Merge pull request #427 from Geolim4/final
Fixed critical bug after item deletion: The item kept in memory was not reset.
2 parents 00f5654 + 2afd22b commit f9c0966

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/phpFastCache/Core/StandardPsr6StructureTrait.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ public function getItem($key)
7373
*/
7474
$this->driverDelete($item);
7575

76+
/**
77+
* Reset the Item
78+
*/
79+
$item->set(null)
80+
->expiresAfter(abs((int) $this->getConfig()[ 'defaultTtl' ]))
81+
->setHit(false)
82+
->setTags([]);
7683
} else {
7784
$item->setHit(true);
7885
}

0 commit comments

Comments
 (0)