Notice fixes. Props DD32. see #7509

git-svn-id: http://svn.automattic.com/wordpress/trunk@9714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-11-15 17:56:44 +00:00
parent 47a824081a
commit 86702a2520
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'];