From: seven Date: Mon, 28 Sep 2020 02:57:42 +0000 (+0100) Subject: Force an index file to be appended to directory paths X-Git-Url: https://reisub.nsupdate.info/git/?p=gemini-php.git%2F.git;a=commitdiff_plain;h=059c9c992f171608b366df1f0f2593ecb3064fe1 Force an index file to be appended to directory paths --- diff --git a/gemini.class.php b/gemini.class.php index 1add152..f055052 100644 --- a/gemini.class.php +++ b/gemini.class.php @@ -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']; }