mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
use maybe_unserialize() in update and API checks, Tighten up the checks on expected return data to avoid processing invalid responses after change. See #19617
git-svn-id: https://develop.svn.wordpress.org/trunk@19707 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -45,9 +45,9 @@ function plugins_api($action, $args = null) {
|
||||
if ( is_wp_error($request) ) {
|
||||
$res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.'), $request->get_error_message() );
|
||||
} else {
|
||||
$res = unserialize( wp_remote_retrieve_body( $request ) );
|
||||
if ( false === $res )
|
||||
$res = new WP_Error('plugins_api_failed', __('An unknown error occurred.'), wp_remote_retrieve_body( $request ) );
|
||||
$res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
|
||||
if ( ! is_object( $res ) && ! is_array( $res ) )
|
||||
$res = new WP_Error('plugins_api_failed', __('An unknown error occurred during the API request.'), wp_remote_retrieve_body( $request ) );
|
||||
}
|
||||
} elseif ( !is_wp_error($res) ) {
|
||||
$res->external = true;
|
||||
|
||||
Reference in New Issue
Block a user