From d1d1e869933ac621d91285656ab8632a0eb07c8b Mon Sep 17 00:00:00 2001 From: Julian Prieber Date: Thu, 25 May 2023 17:34:09 +0200 Subject: [PATCH] Improved compatibility --- app/Http/Controllers/AdminController.php | 37 ++++-------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 36ef23c..6254c70 100755 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -489,38 +489,12 @@ public function SendTestMail(Request $request) function removeFolder($folderName) { - - if (is_dir($folderName)) - - $folderHandle = opendir($folderName); - - - - if (!$folderHandle) - - return false; - - - - while ($file = readdir($folderHandle)) { - - if ($file != "." && $file != "..") { - - if (!is_dir($folderName . "/" . $file)) - - unlink($folderName . "/" . $file); - - else - - removeFolder($folderName . '/' . $file); - } + if (File::exists($folderName)) { + File::deleteDirectory($folderName); + return true; } - - - - closedir($folderHandle); - - rmdir($folderName); + + return false; } removeFolder($folderName); @@ -621,7 +595,6 @@ public function SendTestMail(Request $request) } } - return Redirect('/studio/theme'); }