### Eclipse Workspace Patch 1.0
#P wordpress
|
|
|
1978 | 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 ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers'])) |
1982 | | return ''; |
1983 | | |
1984 | | if ( array_key_exists($header, $response['headers']) ) |
1985 | | return $response['headers'][$header]; |
1986 | | |
1987 | | return ''; |
| 1981 | return isset($response['headers'][$header]) ? $response['headers'][$header] : ''; |
1988 | 1982 | } |
1989 | 1983 | |
1990 | 1984 | /** |
… |
… |
|
1997 | 1991 | * @param array $response HTTP response. |
1998 | 1992 | * @return string the response code. Empty string on incorrect parameter given. |
1999 | 1993 | */ |
2000 | | function wp_remote_retrieve_response_code(&$response) { |
2001 | | if ( is_wp_error($response) ||! isset($response['response']) || ! is_array($response['response'])) |
2002 | | return ''; |
2003 | | |
2004 | | return $response['response']['code']; |
| 1994 | function wp_remote_retrieve_response_code(&$response) { |
| 1995 | return isset($response['response']['code']) ? $response['response']['code'] : ''; |
2005 | 1996 | } |
2006 | 1997 | |
2007 | 1998 | /** |
… |
… |
|
2015 | 2006 | * @return string The response message. Empty string on incorrect parameter given. |
2016 | 2007 | */ |
2017 | 2008 | function wp_remote_retrieve_response_message(&$response) { |
2018 | | if ( is_wp_error($response) || ! isset($response['response']) || ! is_array($response['response'])) |
2019 | | return ''; |
2020 | | |
2021 | | return $response['response']['message']; |
| 2009 | return isset($response['response']['message']) ? $response['response']['message'] : ''; |
2022 | 2010 | } |
2023 | 2011 | |
2024 | 2012 | /** |