diff options
| author | 2013-10-26 16:28:19 +0200 | |
|---|---|---|
| committer | 2013-10-26 16:28:19 +0200 | |
| commit | 8deb3066107383ef22d671962465228a80b74508 (patch) | |
| tree | e37867a932bab89313b6377592e9f931cd56e564 /lib | |
| parent | d94d948706767996102bf53dfc9d651fd58a34e5 (diff) | |
| parent | d70e5bfa8249416673d0dc6c177c2e4c5b6d7490 (diff) | |
Merge branch 'patch-1' of https://github.com/Alkarex/FreshRSS into Alkarex-patch-1
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/minz/Url.php | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/lib/minz/Url.php b/lib/minz/Url.php index c1c3e9a0f..9bda98363 100755 --- a/lib/minz/Url.php +++ b/lib/minz/Url.php @@ -16,25 +16,21 @@ class Url { * @param $encodage pour indiquer comment encoder les & (& ou & pour html) * @return l'url formatée */ - public static function display ($url = array (), $encodage = 'html') { + public static function display ($url = array (), $encodage = 'html', $absolute = false) { $url = self::checkUrl ($url); $url_string = ''; - if (is_array ($url) && isset ($url['protocol'])) { - $protocol = $url['protocol']; - } else { - if(isset($_SERVER['HTTPS']) && $_SERVER["HTTPS"] == 'on') { - $protocol = 'https'; - } else { - $protocol = 'http'; - } + if ($absolute) { + $protocol = (is_array ($url) && isset ($url['protocol'])) ? ($url['protocol'] . ':') : ''; //Empty protocol will use automatic http or https + $url_string = $protocol + . '//' + . Request::getDomainName () + . Request::getBaseUrl (); + } + else { + $url_string = '.'; } - $url_string .= $protocol . '://'; - - $url_string .= Request::getDomainName (); - - $url_string .= Request::getBaseUrl (); if (is_array ($url)) { $router = new Router (); |
