Merge pull request #745 from Zankaria/fix-deprecations

Fix more deprecations
This commit is contained in:
Lorenzo Yario 2024-05-11 06:57:43 -07:00 committed by GitHub
commit feb2860d9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 5 deletions

View File

@ -71,7 +71,7 @@ function createBoardlist($mod=false) {
); );
} }
function error($message, $priority = true, $debug_stuff = false) { function error($message, $priority = true, $debug_stuff = []) {
global $board, $mod, $config, $db_error; global $board, $mod, $config, $db_error;
if ($config['syslog'] && $priority !== false) { if ($config['syslog'] && $priority !== false) {

View File

@ -715,13 +715,19 @@ function file_unlink($path) {
$debug['unlink'][] = $path; $debug['unlink'][] = $path;
} }
if (file_exists($path)) {
$ret = @unlink($path); $ret = @unlink($path);
} else {
$ret = true;
}
if ($config['gzip_static']) { if ($config['gzip_static']) {
$gzpath = "$path.gz"; $gzpath = "$path.gz";
if (file_exists($gzpath)) {
@unlink($gzpath); @unlink($gzpath);
} }
}
if (isset($config['purge']) && $path[0] != '/' && isset($_SERVER['HTTP_HOST'])) { if (isset($config['purge']) && $path[0] != '/' && isset($_SERVER['HTTP_HOST'])) {
// Purge cache // Purge cache