Commit c88c559036 for wordpress.org

commit c88c55903658427f9213219a847eafb6937e165c
Author: wildworks <wildworks@git.wordpress.org>
Date:   Tue Nov 17 12:56:46 2026 +0000

    Privacy: Add a check for post status in `wp_privacy_send_personal_data_export_email()`.

    In `wp_privacy_send_personal_data_export_email()`, the post status was not previously validated before sending the export email. This could lead to export emails being sent for unconfirmed or invalid requests (e.g. `request-pending`, `request-failed`).

    Developed in https://github.com/WordPress/wordpress-develop/pull/12759

    Props pbearne, wildworks, mindctrl, masteradhoc, therssoftware, im3dabasia1.
    Fixes #65758.
    Built from https://develop.svn.wordpress.org/trunk@65551


    git-svn-id: http://core.svn.wordpress.org/trunk@64624 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-admin/includes/privacy-tools.php b/wp-admin/includes/privacy-tools.php
index 17e660c8c0..f0a53f2651 100644
--- a/wp-admin/includes/privacy-tools.php
+++ b/wp-admin/includes/privacy-tools.php
@@ -587,6 +587,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
  * Send an email to the user with a link to the personal data export file
  *
  * @since 4.9.6
+ * @since 7.2.0 Returns a `WP_Error` if the request is not confirmed or completed.
  *
  * @param int $request_id The request ID for this personal data export.
  * @return true|WP_Error True on success or `WP_Error` on failure.
@@ -599,6 +600,10 @@ function wp_privacy_send_personal_data_export_email( $request_id ) {
 		return new WP_Error( 'invalid_request', __( 'Invalid request ID when sending personal data export email.' ) );
 	}

+	if ( ! in_array( $request->status, array( 'request-confirmed', 'request-completed' ), true ) ) {
+		return new WP_Error( 'invalid_request', __( 'Invalid request status when sending personal data export email.' ) );
+	}
+
 	// Localize message content for user; fallback to site default for visitors.
 	if ( ! empty( $request->user_id ) ) {
 		$switched_locale = switch_to_user_locale( $request->user_id );
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 288b604d4d..97fddeeac2 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.2-beta5-65550';
+$wp_version = '7.2-beta5-65551';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.