Actually fix warnings

This commit is contained in:
Dusk 2022-01-27 00:40:40 +01:00
parent 5a1cfd1128
commit c171629563
1 changed files with 6 additions and 6 deletions

View File

@ -43,17 +43,17 @@ function filter_files_dir($files_array, string $path) : array {
$not_found_error = '<h1>File not found, error 404</h1>'; $not_found_error = '<h1>File not found, error 404</h1>';
if(!$files_in_folder) {
echo($not_found_error);
die();
}
$basedir = 'content'; $basedir = 'content';
$request_uri = $_SERVER['REQUEST_URI']; $request_uri = $_SERVER['REQUEST_URI'];
$path = $basedir . $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); $resource_array = filter_files_dir($files_in_folder, $path);
// Show folder links // Show folder links