From a8f493fc347a9b109f2ecf825e536e34e33ed59a Mon Sep 17 00:00:00 2001 From: Lewin Probst Date: Sat, 3 Aug 2019 19:45:26 +0200 Subject: [PATCH] Bugfix, Folder not found although existent in global module. --- module.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module.php b/module.php index b50a467..724908c 100644 --- a/module.php +++ b/module.php @@ -79,6 +79,13 @@ return new class extends Lewp\Module ]); // all images in the folder $gallery_filenames = scandir($gallery_folder); + // check if folder is empty or not available + if ( + ($gallery_filenames === false) + || (sizeof($gallery_filenames) == 2) + ) { + continue; + } foreach ($gallery_filenames as $image) { if ($image === '..' || $image === '.') { continue;