mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Add additional file check before unlink
This commit is contained in:
parent
dfd35559c8
commit
d5d194cf36
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user