mirror of
https://github.com/eapl-gemugami/gemini-php.git
synced 2025-02-01 09:34:17 +00:00
Apply patch from nervuri:matrix.org to address index bug and url parse fix
This commit is contained in:
parent
ec115d017e
commit
68d84394d2
@ -40,8 +40,8 @@ class Gemini {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parse_request($request) {
|
function parse_request($request) {
|
||||||
$data = parse_url($request);
|
$url = trim($request); // strip <CR><LF> from the end
|
||||||
return $data;
|
return parse_url($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_valid_hosts() {
|
function get_valid_hosts() {
|
||||||
@ -93,10 +93,10 @@ class Gemini {
|
|||||||
// wtf am I missing?
|
// wtf am I missing?
|
||||||
$url['path'] = str_replace("__", "", $url['path']);
|
$url['path'] = str_replace("__", "", $url['path']);
|
||||||
// force an index file to be appended if a filename is missing
|
// force an index file to be appended if a filename is missing
|
||||||
if(substr($url['path'], -1) == "/") {
|
if(empty($url['path'])) {
|
||||||
$url['path'] .= $this->default_index_file;
|
|
||||||
} elseif($url['path'] == "/" or $url['path'] == "") {
|
|
||||||
$url['path'] = "/".$this->default_index_file;
|
$url['path'] = "/".$this->default_index_file;
|
||||||
|
} elseif(substr($url['path'], -1) == "/") {
|
||||||
|
$url['path'] .= $this->default_index_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->data_dir.$hostname.$url['path'];
|
return $this->data_dir.$hostname.$url['path'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user