1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-06 03:49:56 +02:00

web_path cleanup

force_ssl was broken, should be fixed now.
This commit is contained in:
Paul Arthur 2012-07-11 14:37:11 -04:00
parent 4ea8af4968
commit cad8d6ac86
2 changed files with 24 additions and 25 deletions

View file

@ -47,16 +47,23 @@ Config::set('prefix', $prefix);
// Register the autoloader
spl_autoload_register(array('Core', 'autoload'), true, true);
/*
Check to see if this is http or https
*/
// Check to see if this is http or https
if ((isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' )
|| (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
|| Config::get('force_ssl')) {
$http_type = "https://";
|| (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')) {
$http_type = 'https://';
}
else {
$http_type = "http://";
$http_type = 'http://';
}
if (isset($_SERVER['HTTP_X_FORWARDED_PORT'])) {
$http_port = $_SERVER['HTTP_X_FORWARDED_PORT'];
}
else if (isset($_SERVER['SERVER_PORT'])) {
$http_port = $_SERVER['SERVER_PORT'];
}
if (!isset($http_port) || !$http_port) {
$http_port = 80;
}
// Define that we've loaded the INIT file