WordPress.org

Make WordPress Core

Ticket #49476: 49476.diff

File 49476.diff, 1.8 KB (added by garrett-eclipse, 16 months ago)

Patch to update links in emails and update the back-compat redirects so they aren't blocked by the user_can_access_admin_page check

  • src/wp-admin/tools.php

     
    1818        }
    1919}
    2020
    21 /** WordPress Administration Bootstrap */
    22 require_once __DIR__ . '/admin.php';
    23 
    2421// The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php.
    2522if ( isset( $_GET['wp-privacy-policy-guide'] ) ) {
     23        require_once dirname(__DIR__) . '/wp-load.php';
    2624        wp_redirect( admin_url( 'privacy-policy-guide.php' ), 301 );
    2725        exit;
    2826} elseif ( isset( $_GET['page'] ) ) {
    2927        // These were also moved to files in WP 5.3.
    3028        if ( 'export_personal_data' === $_GET['page'] ) {
     29                require_once dirname(__DIR__) . '/wp-load.php';
    3130                wp_redirect( admin_url( 'export-personal-data.php' ), 301 );
    3231                exit;
    3332        } elseif ( 'remove_personal_data' === $_GET['page'] ) {
     33                require_once dirname(__DIR__) . '/wp-load.php';
    3434                wp_redirect( admin_url( 'erase-personal-data.php' ), 301 );
    3535                exit;
    3636        }
    3737}
    3838
     39/** WordPress Administration Bootstrap */
     40require_once __DIR__ . '/admin.php';
     41
    3942$title = __( 'Tools' );
    4043
    4144get_current_screen()->add_help_tab(
  • src/wp-includes/user.php

     
    31843184                return;
    31853185        }
    31863186
    3187         $manage_url         = add_query_arg( 'page', $request->action_name, admin_url( 'tools.php' ) );
     3187        if ( 'export_personal_data' === $request->action_name ) {
     3188                $manage_url = admin_url( 'export-personal-data.php' );
     3189        } elseif ( 'remove_personal_data' === $request->action_name ) {
     3190                $manage_url = admin_url( 'erase-personal-data.php' );
     3191        }
    31883192        $action_description = wp_user_request_action_description( $request->action_name );
    31893193
    31903194        /**