Skip to content

Commit 88cb7d9

Browse files
committed
Merge pull request #9 from Nyholm/patch-5
Apply with the latest integration tests
2 parents decb0bc + d923a3a commit 88cb7d9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/AbstractCachePool.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ abstract protected function clearOneObjectFromCache($key);
168168
*/
169169
public function save(CacheItemInterface $item)
170170
{
171+
// This item has no data
172+
if (!$item->isHit()) {
173+
return false;
174+
}
175+
171176
if ($item instanceof TaggableItemInterface) {
172177
$key = $item->getTaggedKey();
173178
} else {
@@ -238,7 +243,7 @@ protected function validateKey($key)
238243
));
239244
}
240245

241-
if (preg_match('|[\{\}\(\)/\\@\:]|', $key)) {
246+
if (preg_match('|[\{\}\(\)/\\\@\:]|', $key)) {
242247
throw new InvalidArgumentException(sprintf(
243248
'Invalid key: "%s". The key contains one or more characters reserved for future extension: {}()/\@:',
244249
$key

0 commit comments

Comments
 (0)