mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Use wp_remote_retrieve_* helper functions instead of the raw HTTP response array. props aaroncampbell, fixes #17416.
git-svn-id: https://develop.svn.wordpress.org/trunk@17928 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -80,9 +80,9 @@ class WP_SimplePie_File extends SimplePie_File {
|
||||
$this->error = 'WP HTTP Error: ' . $res->get_error_message();
|
||||
$this->success = false;
|
||||
} else {
|
||||
$this->headers = $res['headers'];
|
||||
$this->body = $res['body'];
|
||||
$this->status_code = $res['response']['code'];
|
||||
$this->headers = wp_remote_retrieve_headers( $res );
|
||||
$this->body = wp_remote_retrieve_body( $res );
|
||||
$this->status_code = wp_remote_retrieve_response_code( $res );
|
||||
}
|
||||
} else {
|
||||
if ( ! $this->body = file_get_contents($url) ) {
|
||||
@@ -91,4 +91,4 @@ class WP_SimplePie_File extends SimplePie_File {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user