mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +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:
@@ -490,9 +490,9 @@ function download_url( $url, $timeout = 300 ) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
if ( $response['response']['code'] != '200' ){
|
||||
if ( 200 != wp_remote_retrieve_response_code( $response ) ){
|
||||
unlink( $tmpfname );
|
||||
return new WP_Error( 'http_404', trim( $response['response']['message'] ) );
|
||||
return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ) );
|
||||
}
|
||||
|
||||
return $tmpfname;
|
||||
|
||||
Reference in New Issue
Block a user