Add additional file check before unlink

This commit is contained in:
MGatner 2020-02-20 10:06:49 -05:00
parent dfd35559c8
commit d5d194cf36
No known key found for this signature in database
GPG Key ID: BC7C436F28470CC8

View File

@ -321,8 +321,12 @@ class FileHandler implements CacheInterface
$data = unserialize(file_get_contents($this->path . $key));
if ($data['ttl'] > 0 && time() > $data['time'] + $data['ttl'])
{
// If the file is still there then remove it
if (is_file($this->path . $key))
{
unlink($this->path . $key);
}
return false;
}