Additional tests for HTTPS in redirects

This commit is contained in:
2011-06-19 01:47:06 +01:00
parent 5735e0df75
commit d31613c9ec

View File

@@ -91,7 +91,7 @@ class SihnonFramework_Main {
}
public function absoluteUrl($relative_url) {
$secure = isset($_SERVER['SECURE']);
$secure = isset($_SERVER['SECURE']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');
$port = $_SERVER['SERVER_PORT'];
return 'http' . ($secure ? 's' : '') . '://'
. $_SERVER['HTTP_HOST'] . (($port == 80 || ($secure && $port == 443)) ? '' : ':' . $port)