diff options
author | Wave <wave72@users.noreply.github.com> | 2015-11-06 09:09:58 +0100 |
---|---|---|
committer | Wave <wave72@users.noreply.github.com> | 2015-11-06 09:09:58 +0100 |
commit | 30d083ac3cbdf36171cfee7b892271b9b587325c (patch) | |
tree | f2f63728f86f8336330d31ee8edf2fcd742dc71e /include/plugin.php | |
parent | 50cf095c000813d0b1408d929c1fa7422b131a3d (diff) | |
parent | 4ca0c2cfd14df5e2b6e9c7f59a10628f7653d6a4 (diff) | |
download | volse-hubzilla-30d083ac3cbdf36171cfee7b892271b9b587325c.tar.gz volse-hubzilla-30d083ac3cbdf36171cfee7b892271b9b587325c.tar.bz2 volse-hubzilla-30d083ac3cbdf36171cfee7b892271b9b587325c.zip |
Merge pull request #2 from redmatrix/master
Update to latest hubzilla
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-x | include/plugin.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/plugin.php b/include/plugin.php index 4d8405b62..8749f3fbf 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -504,18 +504,21 @@ function script_path() { $scheme = 'https'; else $scheme = 'http'; + + // Some proxy setups may require using http_host - if(x($_SERVER,'SERVER_NAME')) { - $hostname = $_SERVER['SERVER_NAME']; + if(intval(get_app()->config['system']['script_path_use_http_host'])) + $server_var = 'HTTP_HOST'; + else + $server_var = 'SERVER_NAME'; + + + if(x($_SERVER,$server_var)) { + $hostname = $_SERVER[$server_var]; } else { return z_root(); } - - if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) { - $hostname .= ':' . $_SERVER['SERVER_PORT']; - } - return $scheme . '://' . $hostname; } |