Improved compatibility

This commit is contained in:
Julian Prieber 2023-05-25 17:34:09 +02:00
parent a78d471374
commit d1d1e86993
1 changed files with 5 additions and 32 deletions

View File

@ -489,38 +489,12 @@ public function SendTestMail(Request $request)
function removeFolder($folderName) function removeFolder($folderName)
{ {
if (File::exists($folderName)) {
if (is_dir($folderName)) File::deleteDirectory($folderName);
return true;
$folderHandle = opendir($folderName); }
if (!$folderHandle)
return false; return false;
while ($file = readdir($folderHandle)) {
if ($file != "." && $file != "..") {
if (!is_dir($folderName . "/" . $file))
unlink($folderName . "/" . $file);
else
removeFolder($folderName . '/' . $file);
}
}
closedir($folderHandle);
rmdir($folderName);
} }
removeFolder($folderName); removeFolder($folderName);
@ -621,7 +595,6 @@ public function SendTestMail(Request $request)
} }
} }
return Redirect('/studio/theme'); return Redirect('/studio/theme');
} }