summaryrefslogtreecommitdiffstats
path: root/lib/kolab_client_task.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-09-10 10:44:39 +0200
committerAleksander Machniak <alec@alec.pl>2013-09-10 10:44:39 +0200
commit1050cbfc3dad3063283aa2fe6ce4d69d489c09e4 (patch)
tree625fdfe26837b26eecf815015e61ada9d32e458e /lib/kolab_client_task.php
parent49651423dbd22b1cdb736a6b84323a92f9548882 (diff)
downloadwebadmin-1050cbfc3dad3063283aa2fe6ce4d69d489c09e4.tar.gz
Use $_SERVER['SERVER_PORT'] in API url (Bug #2124)
Diffstat (limited to 'lib/kolab_client_task.php')
-rw-r--r--lib/kolab_client_task.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 3936dac..00b74b7 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -139,12 +139,10 @@ class kolab_client_task
{
$url = $this->config_get('api_url', '');
- // TODO: Debug logging
- //console($url);
-
if (!$url) {
- $url = kolab_utils::https_check() ? 'https://' : 'http://';
- $url .= $_SERVER['SERVER_NAME'];
+ $port = $_SERVER['SERVER_PORT'];
+ $url = kolab_utils::https_check() ? 'https://' : 'http://';
+ $url .= $_SERVER['SERVER_NAME'] . ($port ? ":$port" : '');
$url .= preg_replace('/\/?\?.*$/', '', $_SERVER['REQUEST_URI']);
$url .= '/api';
}