aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Url.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Minz/Url.php')
-rw-r--r--lib/Minz/Url.php17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php
index af555a277..4279b045b 100644
--- a/lib/Minz/Url.php
+++ b/lib/Minz/Url.php
@@ -10,7 +10,6 @@ class Minz_Url {
* $url['c'] = controller
* $url['a'] = action
* $url['params'] = tableau des paramètres supplémentaires
- * $url['protocol'] = protocole à utiliser (http par défaut)
* ou comme une chaîne de caractère
* @param $encodage pour indiquer comment encoder les & (& ou & pour html)
* @return l'url formatée
@@ -19,26 +18,24 @@ class Minz_Url {
$isArray = is_array($url);
if ($isArray) {
- $url = self::checkUrl ($url);
+ $url = self::checkUrl($url);
}
$url_string = '';
if ($absolute) {
- if ($isArray && isset ($url['protocol'])) {
- $protocol = $url['protocol'];
- } elseif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
- $protocol = 'https:';
- } else {
- $protocol = 'http:';
+ $url_string = Minz_Request::getBaseUrl(PUBLIC_TO_INDEX_PATH);
+ if ($url_string === PUBLIC_TO_INDEX_PATH) {
+ $url_string = Minz_Request::guessBaseUrl();
}
- $url_string = $protocol . '//' . Minz_Request::getDomainName () . Minz_Request::getBaseUrl ();
} else {
$url_string = $isArray ? '.' : PUBLIC_RELATIVE;
}
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 {
$url_string .= $url;
}