diff --git a/upload/system/library/url.php b/upload/system/library/url.php index 3d506ff0c91..212eb07b0e2 100644 --- a/upload/system/library/url.php +++ b/upload/system/library/url.php @@ -5,7 +5,7 @@ class Url { private $rewrite = array(); public function __construct($server, $ssl = '') { - $this->base = $server; + $this->server = $server; $this->ssl = $ssl; } @@ -15,9 +15,9 @@ public function addRewrite($rewrite) { public function link($route, $args = '', $secure = false) { if ($this->ssl && $secure) { - $url = 'https://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route; + $url = $this->ssl . 'index.php?route=' . $route; } else { - $url = 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route; + $url = $this->server . 'index.php?route=' . $route; } if ($args) {