Changeset 11091
- Timestamp:
- 04/26/2009 11:54:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/http.php
r10870 r11091 1899 1899 * @param string $url Site URL to retrieve. 1900 1900 * @param array $args Optional. Override the defaults. 1901 * @return WP_Error| string The body of the response or WP_Error on failure.1901 * @return WP_Error|array The response or WP_Error on failure. 1902 1902 */ 1903 1903 function wp_remote_request($url, $args = array()) { … … 1915 1915 * @param string $url Site URL to retrieve. 1916 1916 * @param array $args Optional. Override the defaults. 1917 * @return WP_Error| string The body of the response or WP_Error on failure.1917 * @return WP_Error|array The response or WP_Error on failure. 1918 1918 */ 1919 1919 function wp_remote_get($url, $args = array()) { … … 1931 1931 * @param string $url Site URL to retrieve. 1932 1932 * @param array $args Optional. Override the defaults. 1933 * @return WP_Error| string The body of the response or WP_Error on failure.1933 * @return WP_Error|array The response or WP_Error on failure. 1934 1934 */ 1935 1935 function wp_remote_post($url, $args = array()) { … … 1947 1947 * @param string $url Site URL to retrieve. 1948 1948 * @param array $args Optional. Override the defaults. 1949 * @return WP_Error| string The body of the response or WP_Error on failure.1949 * @return WP_Error|array The response or WP_Error on failure. 1950 1950 */ 1951 1951 function wp_remote_head($url, $args = array()) { … … 1963 1963 */ 1964 1964 function wp_remote_retrieve_headers(&$response) { 1965 if ( ! isset($response['headers']) || ! is_array($response['headers']))1965 if ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers'])) 1966 1966 return array(); 1967 1967 … … 1976 1976 * @param array $response 1977 1977 * @param string $header Header name to retrieve value from. 1978 * @return array The header value. Empty string on if incorrect parameter given.1978 * @return string The header value. Empty string on if incorrect parameter given, or if the header doesnt exist. 1979 1979 */ 1980 1980 function wp_remote_retrieve_header(&$response, $header) { 1981 if ( ! isset($response['headers']) || ! is_array($response['headers']))1981 if ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers'])) 1982 1982 return ''; 1983 1983 … … 1996 1996 * 1997 1997 * @param array $response HTTP response. 1998 * @return array The keys 'code' and 'message' give information on the response.1998 * @return string the response code. Empty string on incorrect parameter given. 1999 1999 */ 2000 2000 function wp_remote_retrieve_response_code(&$response) { 2001 if ( ! isset($response['response']) || ! is_array($response['response']))2001 if ( is_wp_error($response) ||! isset($response['response']) || ! is_array($response['response'])) 2002 2002 return ''; 2003 2003 … … 2013 2013 * 2014 2014 * @param array $response HTTP response. 2015 * @return array The keys 'code' and 'message' give information on the response.2015 * @return string The response message. Empty string on incorrect parameter given. 2016 2016 */ 2017 2017 function wp_remote_retrieve_response_message(&$response) { 2018 if ( ! isset($response['response']) || ! is_array($response['response']))2018 if ( is_wp_error($response) || ! isset($response['response']) || ! is_array($response['response'])) 2019 2019 return ''; 2020 2020 … … 2031 2031 */ 2032 2032 function wp_remote_retrieve_body(&$response) { 2033 if ( ! isset($response['body']) )2033 if ( is_wp_error($response) || ! isset($response['body']) ) 2034 2034 return ''; 2035 2035
Note: See TracChangeset
for help on using the changeset viewer.