From 719ef3461b9c049198df420e3c560d9aae51c61f Mon Sep 17 00:00:00 2001 From: desrosj Date: Fri, 7 Aug 2020 13:51:02 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/branches/5.5@48747 git-svn-id: http://core.svn.wordpress.org/branches/5.5@48509 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-debug-data.php | 16 ++++++++-------- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-admin/includes/class-wp-debug-data.php b/wp-admin/includes/class-wp-debug-data.php index 2f438fb363..3f9d9cd659 100644 --- a/wp-admin/includes/class-wp-debug-data.php +++ b/wp-admin/includes/class-wp-debug-data.php @@ -968,11 +968,11 @@ class WP_Debug_Data { 'requires_php' => '', 'compatibility' => new stdClass(), ); - $item = (object) array_merge( $item, array_intersect_key( $plugin, $item ) ); + $item = array_merge( $item, array_intersect_key( $plugin, $item ) ); } /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */ - $auto_update_forced = apply_filters( 'auto_update_plugin', null, $item ); + $auto_update_forced = apply_filters( 'auto_update_plugin', null, (object) $item ); if ( ! is_null( $auto_update_forced ) ) { $enabled = $auto_update_forced; @@ -1104,7 +1104,7 @@ class WP_Debug_Data { } elseif ( isset( $transient->no_update[ $active_theme->stylesheet ] ) ) { $item = $transient->no_update[ $active_theme->stylesheet ]; } else { - $item = (object) array( + $item = array( 'theme' => $active_theme->stylesheet, 'new_version' => $active_theme->version, 'url' => '', @@ -1115,7 +1115,7 @@ class WP_Debug_Data { } /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */ - $auto_update_forced = apply_filters( 'auto_update_theme', null, $item ); + $auto_update_forced = apply_filters( 'auto_update_theme', null, (object) $item ); if ( ! is_null( $auto_update_forced ) ) { $enabled = $auto_update_forced; @@ -1191,7 +1191,7 @@ class WP_Debug_Data { } elseif ( isset( $transient->no_update[ $parent_theme->stylesheet ] ) ) { $item = $transient->no_update[ $parent_theme->stylesheet ]; } else { - $item = (object) array( + $item = array( 'theme' => $parent_theme->stylesheet, 'new_version' => $parent_theme->version, 'url' => '', @@ -1202,7 +1202,7 @@ class WP_Debug_Data { } /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */ - $auto_update_forced = apply_filters( 'auto_update_theme', null, $item ); + $auto_update_forced = apply_filters( 'auto_update_theme', null, (object) $item ); if ( ! is_null( $auto_update_forced ) ) { $enabled = $auto_update_forced; @@ -1280,7 +1280,7 @@ class WP_Debug_Data { } elseif ( isset( $transient->no_update[ $theme_slug ] ) ) { $item = $transient->no_update[ $theme_slug ]; } else { - $item = (object) array( + $item = array( 'theme' => $theme_slug, 'new_version' => $theme->version, 'url' => '', @@ -1291,7 +1291,7 @@ class WP_Debug_Data { } /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */ - $auto_update_forced = apply_filters( 'auto_update_theme', null, $item ); + $auto_update_forced = apply_filters( 'auto_update_theme', null, (object) $item ); if ( ! is_null( $auto_update_forced ) ) { $enabled = $auto_update_forced; diff --git a/wp-includes/version.php b/wp-includes/version.php index 4254965ee8..34dbcb320c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-RC2-48746'; +$wp_version = '5.5-RC2-48747'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.