Adding file_exists check in install/index.php

pull/2409/head
Luca IU2FRL 2023-08-15 22:01:34 +02:00
rodzic a61bf66fe3
commit 4f9249754b
1 zmienionych plików z 14 dodań i 6 usunięć

Wyświetl plik

@ -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)) {