]> git.lizzy.rs Git - dirlistozxa.git/blobdiff - dirlistozxa.php
Fix handling spaces and other encoded characters in folder names
[dirlistozxa.git] / dirlistozxa.php
index 6253106db48b306391f2bc0f6503ede5c5012ee0..7654e8f0b5fec8776aa9a3245fb88b2a4f0e2436 100644 (file)
@@ -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;