forked from GithubBackups/vichan
functions.php: do not fail fail_unlink if the file does not exist
This commit is contained in:
parent
ba2daa88e6
commit
9f46f0fdd4
@ -715,12 +715,18 @@ function file_unlink($path) {
|
|||||||
$debug['unlink'][] = $path;
|
$debug['unlink'][] = $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = @unlink($path);
|
if (file_exists($path)) {
|
||||||
|
$ret = @unlink($path);
|
||||||
|
} else {
|
||||||
|
$ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ($config['gzip_static']) {
|
if ($config['gzip_static']) {
|
||||||
$gzpath = "$path.gz";
|
$gzpath = "$path.gz";
|
||||||
|
|
||||||
@unlink($gzpath);
|
if (file_exists($gzpath)) {
|
||||||
|
@unlink($gzpath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['purge']) && $path[0] != '/' && isset($_SERVER['HTTP_HOST'])) {
|
if (isset($config['purge']) && $path[0] != '/' && isset($_SERVER['HTTP_HOST'])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user