Changeset 19707
- Timestamp:
- 01/08/2012 03:48:05 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/plugin-install.php
r19627 r19707 46 46 $res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.'), $request->get_error_message() ); 47 47 } else { 48 $res = unserialize( wp_remote_retrieve_body( $request ) );49 if ( false === $res)50 $res = new WP_Error('plugins_api_failed', __('An unknown error occurred .'), wp_remote_retrieve_body( $request ) );48 $res = maybe_unserialize( wp_remote_retrieve_body( $request ) ); 49 if ( ! is_object( $res ) && ! is_array( $res ) ) 50 $res = new WP_Error('plugins_api_failed', __('An unknown error occurred during the API request.'), wp_remote_retrieve_body( $request ) ); 51 51 } 52 52 } elseif ( !is_wp_error($res) ) { -
trunk/wp-admin/includes/theme.php
r19684 r19707 410 410 $res = new WP_Error('themes_api_failed', __('An Unexpected HTTP Error occurred during the API request.'), $request->get_error_message() ); 411 411 } else { 412 $res = unserialize( wp_remote_retrieve_body( $request ) );413 if ( ! $res)414 $res = new WP_Error('themes_api_failed', __('An unknown error occurred.'), wp_remote_retrieve_body( $request ) );415 } 416 } 417 //var_dump(array($args, $res)); 412 $res = maybe_unserialize( wp_remote_retrieve_body( $request ) ); 413 if ( ! is_object( $res ) && ! is_array( $res ) ) 414 $res = new WP_Error('themes_api_failed', __('An unknown error occurred during the API request.'), wp_remote_retrieve_body( $request ) ); 415 } 416 } 417 418 418 return apply_filters('themes_api_result', $res, $action, $args); 419 419 } -
trunk/wp-includes/update.php
r19693 r19707 92 92 93 93 $body = trim( wp_remote_retrieve_body( $response ) ); 94 if ( ! $body = maybe_unserialize( $body ) ) 95 return false; 96 if ( ! isset( $body['offers'] ) ) 97 return false; 94 $body = maybe_unserialize( $body ); 95 96 if ( ! is_array( $body ) || ! isset( $body['offers'] ) ) 97 return false; 98 98 99 $offers = $body['offers']; 99 100 … … 206 207 return false; 207 208 208 $response = unserialize( wp_remote_retrieve_body( $raw_response ) );209 210 if ( false !== $response)209 $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) ); 210 211 if ( is_array( $response ) ) 211 212 $new_option->response = $response; 212 213 else … … 320 321 $new_update->checked = $checked; 321 322 322 $response = unserialize( wp_remote_retrieve_body( $raw_response ) );323 if ( false !== $response)323 $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) ); 324 if ( is_array( $response ) ) 324 325 $new_update->response = $response; 325 326
Note: See TracChangeset
for help on using the changeset viewer.