From 377bc577620e4fde85d23152aac6ae70b3d4ef42 Mon Sep 17 00:00:00 2001 From: Clortox Date: Mon, 4 Jan 2021 16:28:39 -0500 Subject: [PATCH] Fix error with nested folders --- listing.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/listing.php b/listing.php index 7b29afb..3cd8032 100644 --- a/listing.php +++ b/listing.php @@ -49,6 +49,7 @@ $path = $_GET['path']; } + $elements = []; if($handle = opendir($dir_dirs[$dir_index] . $path)){ while(false !== ($entry = readdir($handle))){ //exclude . and .. @@ -83,13 +84,22 @@ + Oops! This folder is empty... + + 0 + + emptylisting; + } foreach($elements as $i=>$currentfile){ echo ""; echo "" . $currentfile . ""; $fulldir = $dir_dirs[$dir_index] . $path . "/" . $currentfile; if(is_dir($fulldir)){ echo "View Directory"; echo "" . foldersize($fulldir) . ""; } else {