Notice fixes. Props DD32. see #7509

git-svn-id: https://develop.svn.wordpress.org/trunk@9714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-11-15 17:56:44 +00:00
parent c294b8bf0f
commit 3a7e85c5ec
4 changed files with 12 additions and 7 deletions

View File

@@ -538,12 +538,17 @@ endif;
function _fetch_remote_file ($url, $headers = "" ) {
$resp = wp_remote_request($url, array('headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT));
if ( is_wp_error($resp) ) {
$error = array_shift($resp->errors);
$resp = new stdClass;
$resp->status = 500;
$resp->response_code = 500;
$resp->error = $error[0] . "\n"; //\n = Snoopy compatibility
return $resp;
}
$response = new stdClass;
$response->status = $resp['response']['code'];
$response->response_code = $resp['response']['code'];
$response->headers = $resp['headers'];
$response->results = $resp['body'];