PHP documentation says this can theoretically return false on failure.
HHVM actually returns null when running from the command line, so
this does protect against that.
Change-Id: I0d75b8ed209128a9667ce1e7189597ae9ebc8af6
return;
}
- if ( function_exists( 'apache_request_headers' ) ) {
- foreach ( apache_request_headers() as $tempName => $tempValue ) {
+ $apacheHeaders = function_exists( 'apache_request_headers' ) ? apache_request_headers() : false;
+ if ( $apacheHeaders ) {
+ foreach ( $apacheHeaders as $tempName => $tempValue ) {
$this->headers[strtoupper( $tempName )] = $tempValue;
}
} else {