]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/http.php
WordPress 4.6.3-scripts
[autoinstalls/wordpress.git] / wp-includes / http.php
index dc750371ac8ce7ee3ff275c02e7604e09091c8d6..130eae3c37ccbd8b167afd021683cf3e14e37d58 100644 (file)
@@ -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
  *