From ba2daa88e6b74471bbb9cef7ec0f2cfe95531f0c Mon Sep 17 00:00:00 2001 From: fowr <89118232+perdedora@users.noreply.github.com> Date: Sat, 22 Jul 2023 00:00:58 -0300 Subject: [PATCH 1/2] fix conversion of false to array --- inc/display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/display.php b/inc/display.php index 8a863648..66e4a37f 100644 --- a/inc/display.php +++ b/inc/display.php @@ -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; if ($config['syslog'] && $priority !== false) { From 9f46f0fdd4aa915fab39f91c1e00c36162ecc445 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sat, 11 May 2024 15:37:18 +0200 Subject: [PATCH 2/2] functions.php: do not fail fail_unlink if the file does not exist --- inc/functions.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 61b85a96..be1eb73c 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -715,12 +715,18 @@ function file_unlink($path) { $debug['unlink'][] = $path; } - $ret = @unlink($path); + if (file_exists($path)) { + $ret = @unlink($path); + } else { + $ret = true; + } - if ($config['gzip_static']) { - $gzpath = "$path.gz"; + if ($config['gzip_static']) { + $gzpath = "$path.gz"; - @unlink($gzpath); + if (file_exists($gzpath)) { + @unlink($gzpath); + } } if (isset($config['purge']) && $path[0] != '/' && isset($_SERVER['HTTP_HOST'])) {