From: ROllerozxa Date: Sat, 29 Apr 2023 18:30:32 +0000 (+0200) Subject: Fix handling spaces and other encoded characters in folder names X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=eadae9019c993492def9216cebeb00859e9413d7;p=dirlistozxa.git Fix handling spaces and other encoded characters in folder names --- diff --git a/dirlistozxa.php b/dirlistozxa.php index 6253106..7654e8f 100644 --- a/dirlistozxa.php +++ b/dirlistozxa.php @@ -35,6 +35,9 @@ $ignore_file_list = [ // nginx with default configuration (merge_slashes) doesn't actually need this. $_SERVER['REQUEST_URI'] = str_replace('../', '', $_SERVER['REQUEST_URI']); +// Allow spaces and other heretical stuff in folder names. +$_SERVER['REQUEST_URI'] = urldecode($_SERVER['REQUEST_URI']); + $folder = str_replace('?'.$_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']); $path = $_SERVER['DOCUMENT_ROOT'].$folder;