Privacy: Avoid a PHP 7.4 notice in `WP_Privacy_Policy_Content::text_change_check()`.

When iterating over the items stored in '_wp_suggested_privacy_policy_content` meta value for the Privacy Policy page, make sure the item is an array before accessing its properties.

Props treibstoff.
Fixes #51084.
Built from https://develop.svn.wordpress.org/trunk@48836


git-svn-id: http://core.svn.wordpress.org/trunk@48598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-08-21 01:13:05 +00:00
parent 25b0783629
commit 0c0e39d8bf
2 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ final class WP_Privacy_Policy_Content {
// Remove the extra values added to the meta. // Remove the extra values added to the meta.
foreach ( $old as $key => $data ) { foreach ( $old as $key => $data ) {
if ( ! empty( $data['removed'] ) ) { if ( ! is_array( $data ) || ! empty( $data['removed'] ) ) {
unset( $old[ $key ] ); unset( $old[ $key ] );
continue; continue;
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.6-alpha-48835'; $wp_version = '5.6-alpha-48836';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.