diff options
Diffstat (limited to 'inc/poche/Tools.class.php')
-rwxr-xr-x | inc/poche/Tools.class.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index f3d1013f..9c748391 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -40,6 +40,8 @@ final class Tools | |||
40 | */ | 40 | */ |
41 | public static function getPocheUrl() | 41 | public static function getPocheUrl() |
42 | { | 42 | { |
43 | $baseUrl = ""; | ||
44 | |||
43 | $https = (!empty($_SERVER['HTTPS']) | 45 | $https = (!empty($_SERVER['HTTPS']) |
44 | && (strtolower($_SERVER['HTTPS']) == 'on')) | 46 | && (strtolower($_SERVER['HTTPS']) == 'on')) |
45 | || (isset($_SERVER["SERVER_PORT"]) | 47 | || (isset($_SERVER["SERVER_PORT"]) |
@@ -72,8 +74,15 @@ final class Tools | |||
72 | $serverport = ''; | 74 | $serverport = ''; |
73 | } | 75 | } |
74 | 76 | ||
75 | return 'http' . ($https ? 's' : '') . '://' | 77 | // check if BASE_URL is configured |
76 | . $host . $serverport . $scriptname; | 78 | if(BASE_URL) { |
79 | $baseUrl = BASE_URL; | ||
80 | } else { | ||
81 | $baseUrl = 'http' . ($https ? 's' : '') . '://' . $host . $serverport; | ||
82 | } | ||
83 | |||
84 | return $baseUrl . $scriptname; | ||
85 | |||
77 | } | 86 | } |
78 | 87 | ||
79 | /** | 88 | /** |