* @return array The headers of the response. Empty array if incorrect parameter given.
*/
function wp_remote_retrieve_headers( $response ) {
- if ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers']))
+ if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
return array();
+ }
return $response['headers'];
}
* @return string The header value. Empty string on if incorrect parameter given, or if the header doesn't exist.
*/
function wp_remote_retrieve_header( $response, $header ) {
- if ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers']))
+ if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
return '';
+ }
- if ( array_key_exists($header, $response['headers']) )
+ if ( isset( $response['headers'][ $header ] ) ) {
return $response['headers'][$header];
+ }
return '';
}
/**
* Whitelists allowed redirect hosts for safe HTTP requests as well.
*
- * Attached to the http_request_host_is_external filter.
+ * Attached to the {@see 'http_request_host_is_external'} filter.
*
* @since 3.6.0
*
/**
* Whitelists any domain in a multisite installation for safe HTTP requests.
*
- * Attached to the http_request_host_is_external filter.
+ * Attached to the {@see 'http_request_host_is_external'} filter.
*
* @since 3.6.0
*