Make WordPress Core

Changeset 48747 for branches/5.5


Ignore:
Timestamp:
08/07/2020 01:49:47 PM (6 years ago)
Author:
desrosj
Message:

Site Health: Consistently pass an object to the auto_update_{$type} filter in Site Health debug data.

Previously, some instances of the filter received an array from a plugin or theme update response, potentially triggering PHP notices.

Merges [48745] to the 5.5 branch.
Reviewed by desrosj, SergeyBiryukov.
Props bpayton, pbiron.
Fixes #50852.

Location:
branches/5.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5

  • branches/5.5/src/wp-admin/includes/class-wp-debug-data.php

    r48732 r48747  
    969969                                                'compatibility' => new stdClass(),
    970970                                        );
    971                                         $item = (object) array_merge( $item, array_intersect_key( $plugin, $item ) );
     971                                        $item = array_merge( $item, array_intersect_key( $plugin, $item ) );
    972972                                }
    973973
    974974                                /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */
    975                                 $auto_update_forced = apply_filters( 'auto_update_plugin', null, $item );
     975                                $auto_update_forced = apply_filters( 'auto_update_plugin', null, (object) $item );
    976976
    977977                                if ( ! is_null( $auto_update_forced ) ) {
     
    11051105                                $item = $transient->no_update[ $active_theme->stylesheet ];
    11061106                        } else {
    1107                                 $item = (object) array(
     1107                                $item = array(
    11081108                                        'theme'        => $active_theme->stylesheet,
    11091109                                        'new_version'  => $active_theme->version,
     
    11161116
    11171117                        /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */
    1118                         $auto_update_forced = apply_filters( 'auto_update_theme', null, $item );
     1118                        $auto_update_forced = apply_filters( 'auto_update_theme', null, (object) $item );
    11191119
    11201120                        if ( ! is_null( $auto_update_forced ) ) {
     
    11921192                                        $item = $transient->no_update[ $parent_theme->stylesheet ];
    11931193                                } else {
    1194                                         $item = (object) array(
     1194                                        $item = array(
    11951195                                                'theme'        => $parent_theme->stylesheet,
    11961196                                                'new_version'  => $parent_theme->version,
     
    12031203
    12041204                                /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */
    1205                                 $auto_update_forced = apply_filters( 'auto_update_theme', null, $item );
     1205                                $auto_update_forced = apply_filters( 'auto_update_theme', null, (object) $item );
    12061206
    12071207                                if ( ! is_null( $auto_update_forced ) ) {
     
    12811281                                        $item = $transient->no_update[ $theme_slug ];
    12821282                                } else {
    1283                                         $item = (object) array(
     1283                                        $item = array(
    12841284                                                'theme'        => $theme_slug,
    12851285                                                'new_version'  => $theme->version,
     
    12921292
    12931293                                /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */
    1294                                 $auto_update_forced = apply_filters( 'auto_update_theme', null, $item );
     1294                                $auto_update_forced = apply_filters( 'auto_update_theme', null, (object) $item );
    12951295
    12961296                                if ( ! is_null( $auto_update_forced ) ) {
Note: See TracChangeset for help on using the changeset viewer.