From 24567bf775f21831bf4cd4c6af5aa08594c116f6 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 3 Mar 2020 00:50:06 +0000 Subject: [PATCH] Privacy: Fix the URLs and legacy redirects for the personal data export and erasure screens. Props Jurgen Oldenburg, garrett-eclipse Fixes #49476 Built from https://develop.svn.wordpress.org/trunk@47412 git-svn-id: http://core.svn.wordpress.org/trunk@47199 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/tools.php | 9 ++++++--- wp-includes/user.php | 6 +++++- wp-includes/version.php | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/wp-admin/tools.php b/wp-admin/tools.php index 76f2a85ab7..ff72cec4a1 100644 --- a/wp-admin/tools.php +++ b/wp-admin/tools.php @@ -18,24 +18,27 @@ if ( isset( $_GET['page'] ) && ! empty( $_POST ) ) { } } -/** WordPress Administration Bootstrap */ -require_once __DIR__ . '/admin.php'; - // The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php. if ( isset( $_GET['wp-privacy-policy-guide'] ) ) { + require_once dirname( __DIR__ ) . '/wp-load.php'; wp_redirect( admin_url( 'privacy-policy-guide.php' ), 301 ); exit; } elseif ( isset( $_GET['page'] ) ) { // These were also moved to files in WP 5.3. if ( 'export_personal_data' === $_GET['page'] ) { + require_once dirname( __DIR__ ) . '/wp-load.php'; wp_redirect( admin_url( 'export-personal-data.php' ), 301 ); exit; } elseif ( 'remove_personal_data' === $_GET['page'] ) { + require_once dirname( __DIR__ ) . '/wp-load.php'; wp_redirect( admin_url( 'erase-personal-data.php' ), 301 ); exit; } } +/** WordPress Administration Bootstrap */ +require_once __DIR__ . '/admin.php'; + $title = __( 'Tools' ); get_current_screen()->add_help_tab( diff --git a/wp-includes/user.php b/wp-includes/user.php index d8f3060421..f0cc8c33bd 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -3188,7 +3188,11 @@ function _wp_privacy_send_request_confirmation_notification( $request_id ) { return; } - $manage_url = add_query_arg( 'page', $request->action_name, admin_url( 'tools.php' ) ); + if ( 'export_personal_data' === $request->action_name ) { + $manage_url = admin_url( 'export-personal-data.php' ); + } elseif ( 'remove_personal_data' === $request->action_name ) { + $manage_url = admin_url( 'erase-personal-data.php' ); + } $action_description = wp_user_request_action_description( $request->action_name ); /** diff --git a/wp-includes/version.php b/wp-includes/version.php index d008e442c0..0fbcb636b6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-beta3-47411'; +$wp_version = '5.4-beta3-47412'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.