Check file exists before unlinking in 'file_unlink'
This commit is contained in:
parent
4eae6fd37e
commit
837fe4d6fa
|
@ -795,12 +795,16 @@ function file_unlink($path) {
|
||||||
$debug['unlink'][] = $path;
|
$debug['unlink'][] = $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = @unlink($path);
|
if (file_exists($path)) {
|
||||||
|
$ret = @unlink($path);
|
||||||
|
|
||||||
if ($config['gzip_static']) {
|
if ($config['gzip_static']) {
|
||||||
$gzpath = "$path.gz";
|
$gzpath = "$path.gz";
|
||||||
|
|
||||||
@unlink($gzpath);
|
@unlink($gzpath);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$ret = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['purge']) && $path[0] != '/' && isset($_SERVER['HTTP_HOST'])) {
|
if (isset($config['purge']) && $path[0] != '/' && isset($_SERVER['HTTP_HOST'])) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user