Browse Source

Check file exists before unlinking in 'file_unlink'

main
discomrade 2 years ago
committed by -
parent
commit
837fe4d6fa
  1. 4
      inc/functions.php

4
inc/functions.php

@ -795,6 +795,7 @@ function file_unlink($path) {
$debug['unlink'][] = $path;
}
if (file_exists($path)) {
$ret = @unlink($path);
if ($config['gzip_static']) {
@ -802,6 +803,9 @@ function file_unlink($path) {
@unlink($gzpath);
}
} else {
$ret = false;
}
if (isset($config['purge']) && $path[0] != '/' && isset($_SERVER['HTTP_HOST'])) {
// Purge cache

Loading…
Cancel
Save