Array key check for _SERVER['HTTPS']

Preventing a PHP warning
This commit is contained in:
Emmanuel BENOîT 2016-01-01 23:39:16 +01:00
parent 3f70ec0381
commit 90e09c35cd

View file

@ -55,7 +55,7 @@ abstract class Page
if ( $rc{0} != '/' ) {
$rc = $this->baseURL . '/' . $rc;
}
$rc = ( $_SERVER[ 'HTTPS' ] ? 'https' : 'http' ) . '://' . $_SERVER[ 'SERVER_NAME' ]
$rc = ( ( array_key_exists( 'HTTPS' , $_SERVER ) && $_SERVER[ 'HTTPS' ] ) ? 'https' : 'http' ) . '://' . $_SERVER[ 'SERVER_NAME' ]
. ':' . $_SERVER[ 'SERVER_PORT' ] . $rc;
header( "Location: $rc" );
$rv = true;