From 4f9249754b6dd3fa4a9281738a56413c0c308ea7 Mon Sep 17 00:00:00 2001 From: Luca IU2FRL Date: Tue, 15 Aug 2023 22:01:34 +0200 Subject: [PATCH] Adding file_exists check in install/index.php --- install/index.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/install/index.php b/install/index.php index cc0e5d8b..1e65398d 100644 --- a/install/index.php +++ b/install/index.php @@ -7,13 +7,21 @@ $db_file_path = $db_config_path."database.php"; function delDir($dir) { $files = glob( $dir . '*', GLOB_MARK ); - foreach( $files as $file ){ - if( substr( $file, -1 ) == '/' ) - delDir( $file ); - else - unlink( $file ); + foreach ( $files as $file ) { + if ( substr( $file, -1 ) == '/' ) { + if (file_exists($file)) { + delDir( $file ); + } + } else { + if (file_exists($file)) { + unlink( $file ); + } + } } - rmdir( $dir ); + // This step may be not needed + if (file_exists($dir)) { + rmdir( $dir ); + } } if (file_exists($db_file_path)) {