Force an index file to be appended to directory paths
authorseven <seven@cygni>
Mon, 28 Sep 2020 02:57:42 +0000 (03:57 +0100)
committerseven <seven@cygni>
Mon, 28 Sep 2020 02:57:42 +0000 (03:57 +0100)
gemini.class.php

index 1add152510410fb97eba2b366f4e8034e7683e63..f0550526484d52831500a09754067095b568d415 100644 (file)
@@ -98,8 +98,12 @@ class Gemini {
                // Kristall Browser is adding "__" to the end of the filenames
                // wtf am I missing?
                $url['path'] = str_replace("__", "", $url['path']);
-               if(substr($url['path'], -1) == "/" or $url['path'] == "/" or $url['path'] == "")
+               // force an index file to be appended if a filename is missing
+               if(substr($url['path'], -1) == "/") {
+                       $url['path'] .= $this->default_index_file;
+               } elseif($url['path'] == "/" or $url['path'] == "") {
                        $url['path'] = "/".$this->default_index_file;
+               }
 
                return $this->data_dir.$hostname.$url['path'];
        }