From e8b00da747823d0bfbc9da657bb127094c444f78 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 21 Sep 2020 13:49:07 +0000 Subject: [PATCH] Privacy: Check if the accumulated data in `wp_privacy_process_personal_data_export_page()` is not empty. This avoids an error on PHP 8 caused by passing an empty string to `array_merge()`, instead of an array. See #50913. git-svn-id: https://develop.svn.wordpress.org/trunk@49026 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/privacy-tools.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/privacy-tools.php b/src/wp-admin/includes/privacy-tools.php index ada0f11410..ff3e6cadd2 100644 --- a/src/wp-admin/includes/privacy-tools.php +++ b/src/wp-admin/includes/privacy-tools.php @@ -767,7 +767,11 @@ function wp_privacy_process_personal_data_export_page( $response, $exporter_inde if ( 1 === $exporter_index && 1 === $page ) { update_post_meta( $request_id, '_export_data_raw', $export_data ); } else { - $export_data = get_post_meta( $request_id, '_export_data_raw', true ); + $accumulated_data = get_post_meta( $request_id, '_export_data_raw', true ); + + if ( $accumulated_data ) { + $export_data = $accumulated_data; + } } // Now, merge the data from the exporter response into the data we have accumulated already.