From 742e0d5c9b573c181a963a29ab48b38eaefc6c66 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 16 Jun 2022 13:07:53 +1000 Subject: [PATCH] Clean up for self updater --- app/Http/Controllers/SelfUpdateController.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index 051b4066d1..6eda9a83e8 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -203,15 +203,15 @@ class SelfUpdateController extends BaseController foreach ($iterator as $file) { - if($file->isDir() && !$file->isDot() && ($current_revision_text != $file->getFileName())) - { - - $directoryIterator = new \RecursiveDirectoryIterator(base_path('vendor/beganovich/snappdf/versions/'.$file->getFileName()), \RecursiveDirectoryIterator::SKIP_DOTS); - - foreach (new \RecursiveIteratorIterator($directoryIterator) as $filex) + if($file->isDir() && !$file->isDot() && ($current_revision_text != $file->getFileName())) { - unlink($filex->getPathName()); - } + + $directoryIterator = new \RecursiveDirectoryIterator(base_path('vendor/beganovich/snappdf/versions/'.$file->getFileName()), \RecursiveDirectoryIterator::SKIP_DOTS); + + foreach (new \RecursiveIteratorIterator($directoryIterator) as $filex) + { + unlink($filex->getPathName()); + } }