X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=dirlistozxa.php;h=7654e8f0b5fec8776aa9a3245fb88b2a4f0e2436;hb=eadae9019c993492def9216cebeb00859e9413d7;hp=6d3c4b5e45a7c0c092945d8c1675656065549ca7;hpb=f126c06050f97582a999c9e2e8191d5db6fc34c5;p=dirlistozxa.git diff --git a/dirlistozxa.php b/dirlistozxa.php index 6d3c4b5..7654e8f 100644 --- a/dirlistozxa.php +++ b/dirlistozxa.php @@ -1,4 +1,23 @@ . + * + * This software is best enjoyed with soused herring! + */ + // Configuration: // List of filenames (and folder names) that should be ignored. @@ -16,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; @@ -42,8 +64,12 @@ function row($name, $date, $size, $thumb) { }; return sprintf( - '%s%s%s', - $img, $name, $name, $date, $size); + ' + + %s + %s%s + ', + $name, $img, $name, $name, $date, $size); } function build_blocks($items) {