X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/784f914b1e4b1c62d6657e86397c2e83bcee4295..073c5ed6408e2f00dc1863b463fe205467628905:/wp-includes/http.php diff --git a/wp-includes/http.php b/wp-includes/http.php index dc750371..130eae3c 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -213,8 +213,9 @@ function wp_remote_head($url, $args = array()) { * @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']; } @@ -229,11 +230,13 @@ function wp_remote_retrieve_headers( $response ) { * @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 ''; } @@ -578,7 +581,7 @@ function wp_http_validate_url( $url ) { /** * 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 * @@ -595,7 +598,7 @@ function allowed_http_request_hosts( $is_external, $host ) { /** * 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 *