]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Tools.class.php
fix BASE_URL
[github/wallabag/wallabag.git] / inc / poche / Tools.class.php
index f3d1013fe52522f611fa8563d1c657c618fa6626..6c176eae5c3048dd53368284aed2a1988f69647f 100755 (executable)
@@ -40,6 +40,8 @@ final class Tools
      */
     public static function getPocheUrl()
     {
+       $baseUrl = "";
+
         $https = (!empty($_SERVER['HTTPS'])
                     && (strtolower($_SERVER['HTTPS']) == 'on'))
             || (isset($_SERVER["SERVER_PORT"])
@@ -72,8 +74,16 @@ final class Tools
             $serverport = '';
         }
 
-        return 'http' . ($https ? 's' : '') . '://'
-            . $host . $serverport . $scriptname;
+               // check if BASE_URL is configured
+               if(BASE_URL) {
+                       print_r(BASE_URL);
+                       $baseUrl = BASE_URL;
+               } else {
+                       $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport;
+               }
+
+    return $baseUrl . $scriptname;
+    
     }
 
     /**