aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-10-25 15:37:09 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-10-25 15:37:09 -0700
commit7f3df847a2ba1e836c930f89a681e1589131f557 (patch)
tree0bb56227da3d3d87877c0542ff834db2f0af7cad /include
parente0424fe6cc55eed3cc418e404c4e793f20618fcf (diff)
downloadvolse-hubzilla-7f3df847a2ba1e836c930f89a681e1589131f557.tar.gz
volse-hubzilla-7f3df847a2ba1e836c930f89a681e1589131f557.tar.bz2
volse-hubzilla-7f3df847a2ba1e836c930f89a681e1589131f557.zip
make use of http_host vs. server_name configurable in script_path()
Diffstat (limited to 'include')
-rwxr-xr-xinclude/plugin.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/plugin.php b/include/plugin.php
index c05e8f577..8749f3fbf 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -504,9 +504,17 @@ function script_path() {
$scheme = 'https';
else
$scheme = 'http';
+
+ // Some proxy setups may require using http_host
- if(x($_SERVER,'HTTP_HOST')) {
- $hostname = $_SERVER['HTTP_HOST'];
+ 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();