From 493a88c666484fb9458d51f2d393d200e9551f63 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 21 Aug 2020 01:11:19 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@48836 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-privacy-policy-content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-privacy-policy-content.php b/src/wp-admin/includes/class-wp-privacy-policy-content.php index 676d5b6736..dd704bdecf 100644 --- a/src/wp-admin/includes/class-wp-privacy-policy-content.php +++ b/src/wp-admin/includes/class-wp-privacy-policy-content.php @@ -87,7 +87,7 @@ final class WP_Privacy_Policy_Content { // Remove the extra values added to the meta. foreach ( $old as $key => $data ) { - if ( ! empty( $data['removed'] ) ) { + if ( ! is_array( $data ) || ! empty( $data['removed'] ) ) { unset( $old[ $key ] ); continue; }