Adding HTTPS detection fix (Ticket #1405)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3531 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2006-09-20 19:13:57 +00:00
parent cc8b842467
commit 355ad78cc1
2 changed files with 11 additions and 4 deletions

View file

@ -800,6 +800,14 @@
*/
function env($key) {
if ($key == 'HTTPS') {
if (isset($_SERVER) && !empty($_SERVER)) {
return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');
} else {
return (strpos(env('SCRIPT_URI'), 'https://') === 0);
}
}
if ($key == 'SCRIPT_NAME') {
if (env('CGI_MODE')) {
$key = 'SCRIPT_URL';

View file

@ -154,17 +154,16 @@
* Full url prefix
*/
$s = null;
$https = env('HTTPS');
if ( (isset($https) && $https =='on' )) {
if (env('HTTPS')) {
$s ='s';
}
unset($https);
$httpHost = env('HTTP_HOST');
if (isset($httpHost)) {
define('FULL_BASE_URL', 'http'.$s.'://'.$httpHost);
}
unset($httpHost);
unset($httpHost, $s);
/**
* Web path to the public images directory.
*/