Make WordPress Core


Ignore:
Timestamp:
11/02/2020 07:11:32 PM (4 years ago)
Author:
desrosj
Message:

Upgrade/Install: Prevent removal of additional data from plugin update info.

This switches to using wp_parse_args() instead of a combination of array_merge() and array_intersect_key() when ensuring that all expected default keys are present in the update information for a plugin.

This prevents non-default data returned by 3rd-party plugins from being unintentionally stripped out.

Props peterwilsoncc, chriscct7.
Fixes #51609.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r49284 r49477  
    231231            );
    232232
    233             $filter_payload = (object) array_merge( $filter_payload, array_intersect_key( $plugin_data, $filter_payload ) );
     233            $filter_payload = (object) wp_parse_args( $plugin_data, $filter_payload );
    234234
    235235            $auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, $filter_payload );
Note: See TracChangeset for help on using the changeset viewer.