lib/kolab_client_task.php

Aleksander Machniak machniak at kolabsys.com
Tue Sep 10 10:45:38 CEST 2013


 lib/kolab_client_task.php |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 1050cbfc3dad3063283aa2fe6ce4d69d489c09e4
Author: Aleksander Machniak <alec at alec.pl>
Date:   Tue Sep 10 10:44:39 2013 +0200

    Use $_SERVER['SERVER_PORT'] in API url (Bug #2124)

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';
         }




More information about the commits mailing list