WordPress.org

Make WordPress Core

Changeset 48836


Ignore:
Timestamp:
08/21/2020 01:11:19 AM (10 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php

    r48588 r48836  
    8888        // Remove the extra values added to the meta.
    8989        foreach ( $old as $key => $data ) {
    90             if ( ! empty( $data['removed'] ) ) {
     90            if ( ! is_array( $data ) || ! empty( $data['removed'] ) ) {
    9191                unset( $old[ $key ] );
    9292                continue;
Note: See TracChangeset for help on using the changeset viewer.