diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2012-07-11 14:37:11 -0400 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2012-07-11 14:37:11 -0400 |
commit | cad8d6ac865508cf1451b36cfd07d5c0c9378372 (patch) | |
tree | d4a3cba67f2313955215e7671d4d64d281a7e7b2 /lib/init.php | |
parent | 4ea8af496871385e5c9c37b15ed71f133cf99a29 (diff) | |
download | ampache-cad8d6ac865508cf1451b36cfd07d5c0c9378372.tar.gz ampache-cad8d6ac865508cf1451b36cfd07d5c0c9378372.tar.bz2 ampache-cad8d6ac865508cf1451b36cfd07d5c0c9378372.zip |
web_path cleanup
force_ssl was broken, should be fixed now.
Diffstat (limited to 'lib/init.php')
-rw-r--r-- | lib/init.php | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/lib/init.php b/lib/init.php index 9f6a5730..1cfacb8f 100644 --- a/lib/init.php +++ b/lib/init.php @@ -73,25 +73,17 @@ if ($link) { $results['version'] = '3.6-Alpha1-DEV'; $results['int_config_version'] = '11'; -$results['raw_web_path'] = $results['web_path']; -$results['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path']; -if (isset($_SERVER['HTTP_X_FORWARDED_PORT'])) { - $results['http_port'] = $_SERVER['HTTP_X_FORWARDED_PORT']; -} else { - $results['http_port'] = $_SERVER['SERVER_PORT']; -} -if (!$results['http_port']) { - $results['http_port'] = '80'; -} -if (!$results['site_charset']) { - $results['site_charset'] = "UTF-8"; -} -if (!$results['raw_web_path']) { - $results['raw_web_path'] = '/'; -} -if (!$_SERVER['SERVER_NAME']) { - $_SERVER['SERVER_NAME'] = ''; +if ($results['force_ssl']) { + $http_type = 'https://'; } + +$results['raw_web_path'] = $results['web_path']; +$results['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path']; +$results['http_port'] = $results['http_port'] ?: $http_port; +$results['site_charset'] = $results['site_charset'] ?: 'UTF-8'; +$results['raw_web_path'] = $results['raw_web_path'] ?: '/'; +$_SERVER['SERVER_NAME'] = $_SERVER['SERVER_NAME'] ?: ''; + if (isset($results['user_ip_cardinality']) && !$results['user_ip_cardinality']) { $results['user_ip_cardinality'] = 42; } |