mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
parent
cc8b842467
commit
355ad78cc1
2 changed files with 11 additions and 4 deletions
|
@ -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';
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue