From c171629563a4886c3bc033f9016e4f30e2943ebb Mon Sep 17 00:00:00 2001 From: Strangedusk Date: Thu, 27 Jan 2022 00:40:40 +0100 Subject: [PATCH] Actually fix warnings --- index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index e40ddb4..dfb9c61 100755 --- a/index.php +++ b/index.php @@ -43,17 +43,17 @@ function filter_files_dir($files_array, string $path) : array { $not_found_error = '

File not found, error 404

'; -if(!$files_in_folder) { - echo($not_found_error); - die(); -} - $basedir = 'content'; $request_uri = $_SERVER['REQUEST_URI']; $path = $basedir . $request_uri; -$files_in_folder = scandir($path); +if(!is_dir($path)) { + echo($not_found_error); + die(); +} + +$files_in_folder = scandir($path); $resource_array = filter_files_dir($files_in_folder, $path); // Show folder links