Make WordPress Core

Changeset 48745 for trunk


Ignore:
Timestamp:
08/07/2020 01:26:11 PM (4 years ago)
Author:
SergeyBiryukov
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.

Props bpayton, pbiron.
Fixes #50852.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-debug-data.php

    r48731 r48745  
    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.