summaryrefslogtreecommitdiff
path: root/lib/Minz/Url.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Minz/Url.php')
-rw-r--r--lib/Minz/Url.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php
index 4279b045b..c7c67123e 100644
--- a/lib/Minz/Url.php
+++ b/lib/Minz/Url.php
@@ -24,10 +24,16 @@ class Minz_Url {
$url_string = '';
if ($absolute) {
- $url_string = Minz_Request::getBaseUrl(PUBLIC_TO_INDEX_PATH);
- if ($url_string === PUBLIC_TO_INDEX_PATH) {
+ $url_string = Minz_Request::getBaseUrl();
+ if ($url_string == '') {
$url_string = Minz_Request::guessBaseUrl();
}
+ if ($isArray) {
+ $url_string .= PUBLIC_TO_INDEX_PATH;
+ }
+ if ($absolute === 'root') {
+ $url_string = parse_url($url_string, PHP_URL_PATH);
+ }
} else {
$url_string = $isArray ? '.' : PUBLIC_RELATIVE;
}