Change-Id: I4debf1460b6357962fc634f781416929bcca2d76
* @return array
*/
public static function detectProtocolAndStdPort() {
- return ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ? array( 'https', 443 ) : array( 'http', 80 );
+ if ( ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ||
+ ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
+ $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) ) {
+ $arr = array( 'https', 443 );
+ } else {
+ $arr = array( 'http', 80 );
+ }
+ return $arr;
}
/**