Changeset 17928 for trunk/wp-includes/update.php
- Timestamp:
- 05/14/2011 07:45:07 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/update.php
r17619 r17928 72 72 $response = wp_remote_get($url, $options); 73 73 74 if ( is_wp_error( $response ) ) 75 return false; 76 77 if ( 200 != $response['response']['code'] ) 78 return false; 79 80 $body = trim( $response['body'] ); 74 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) 75 return false; 76 77 $body = trim( wp_remote_retrieve_body( $response ) ); 81 78 $body = str_replace(array("\r\n", "\r"), "\n", $body); 82 79 $new_options = array(); … … 176 173 $raw_response = wp_remote_post('http://api.wordpress.org/plugins/update-check/1.0/', $options); 177 174 178 if ( is_wp_error( $raw_response ) ) 179 return false; 180 181 if ( 200 != $raw_response['response']['code'] ) 182 return false; 183 184 $response = unserialize( $raw_response['body'] ); 175 if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) 176 return false; 177 178 $response = unserialize( wp_remote_retrieve_body( $raw_response ) ); 185 179 186 180 if ( false !== $response ) … … 274 268 $raw_response = wp_remote_post( 'http://api.wordpress.org/themes/update-check/1.0/', $options ); 275 269 276 if ( is_wp_error( $raw_response ) ) 277 return false; 278 279 if ( 200 != $raw_response['response']['code'] ) 270 if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) 280 271 return false; 281 272 … … 284 275 $new_update->checked = $checked; 285 276 286 $response = unserialize( $raw_response['body']);277 $response = unserialize( wp_remote_retrieve_body( $raw_response ) ); 287 278 if ( false !== $response ) 288 279 $new_update->response = $response;
Note: See TracChangeset
for help on using the changeset viewer.