From 4e8932d4bb7ee95775025f382ef5ea601abd493a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 9 Sep 2018 00:51:02 +0200 Subject: Minz: fix absolute URL bug (#2006) * Fix absolute URL bug https://github.com/FreshRSS/FreshRSS/issues/1946 * Better base_url guess in install.php * Revert changes in install.php --- lib/Minz/Url.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Minz/Url.php') diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php index 99c0443c1..1c222ce25 100644 --- a/lib/Minz/Url.php +++ b/lib/Minz/Url.php @@ -27,6 +27,10 @@ class Minz_Url { $url_string = Minz_Request::getBaseUrl(); if ($url_string == '') { $url_string = Minz_Request::guessBaseUrl(); + if (PUBLIC_RELATIVE === '..') { + //TODO: Implement proper resolver of relative parts such as /test/./../ + $url_string = dirname($url_string); + } } if ($isArray) { $url_string .= PUBLIC_TO_INDEX_PATH; @@ -39,7 +43,7 @@ class Minz_Url { } if ($isArray) { - $url_string .= self::printUri($url, $encodage); + $url_string .= '/' . self::printUri($url, $encodage); } elseif ($encodage === 'html') { $url_string = Minz_Helper::htmlspecialchars_utf8($url_string . $url); } else { -- cgit v1.2.3