From 4aba95edd1281d5b4acfb9c396412cd0912caba6 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Fri, 17 Feb 2023 15:38:31 +0100 Subject: [PATCH] fix PHP8 errors --- setup/lib/functions.filesystem.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup/lib/functions.filesystem.php b/setup/lib/functions.filesystem.php index 5ea0950..bf5b40b 100644 --- a/setup/lib/functions.filesystem.php +++ b/setup/lib/functions.filesystem.php @@ -122,7 +122,7 @@ function canWriteFile($sFilename) { * a wrong information */ $fp = @fopen($sRandFilenamePath, "w"); - if ($fp) { + if (is_resource($fp)) { @fclose($fp); unlink($sRandFilenamePath); return true; @@ -143,8 +143,10 @@ function canWriteFile($sFilename) { /* Ignore errors in case isWriteable() returns * a wrong information */ - $fp = @fopen($sFilename, "w"); - @fclose($fp); + $fp = fopen($sFilename, "w"); + if (is_resource($fp)) { + fclose($fp); + } if (file_exists($sFilename)) { @unlink($sFilename);