BUGFIX: Director::protocol() was returning https when $_SERVER['HTTPS'] was an empty value.

This commit is contained in:
Simon Welsh 2012-05-13 20:44:16 +12:00
parent 368081f63c
commit 3f3e34a109

View File

@ -375,7 +375,7 @@ class Director implements TemplateGlobalProvider {
*/
static function protocol() {
if(isset($_SERVER['HTTP_X_FORWARDED_PROTOCOL']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTOCOL']) == 'https') return "https://";
return (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) ? 'https://' : 'http://';
return (isset($_SERVER['SSL']) || (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) ? 'https://' : 'http://';
}
/**