Make WordPress Core

Ticket #43908: 43908.3.diff

File 43908.3.diff, 1.2 KB (added by pmbaldha, 6 years ago)

Refreshed patch

  • src/wp-admin/includes/file.php

    diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
    index 4bec958b25..0e7bdb2a3c 100644
    a b function wp_privacy_generate_personal_data_export_file( $request_id ) { 
    20482048        $obscura              = wp_generate_password( 32, false, false );
    20492049        $file_basename        = 'wp-personal-data-file-' . $stripped_email . '-' . $obscura;
    20502050        $html_report_filename = $file_basename . '.html';
    2051         $html_report_pathname = $exports_dir . $html_report_filename;
     2051        $html_report_pathname = wp_normalize_path( $exports_dir . $html_report_filename );
    20522052        $file = fopen( $html_report_pathname, 'w' );
    20532053        if ( false === $file ) {
    20542054                wp_send_json_error( __( 'Unable to open export file (HTML report) for writing.' ) );
    function wp_privacy_generate_personal_data_export_file( $request_id ) { 
    21442144                $archive_url      = $exports_url . $archive_filename;
    21452145
    21462146                update_post_meta( $request_id, '_export_file_url', $archive_url );
    2147                 update_post_meta( $request_id, '_export_file_path', $archive_pathname );
     2147                update_post_meta( $request_id, '_export_file_path', wp_normalize_path( $archive_pathname ) );
    21482148        }
    21492149
    21502150        if ( ! empty( $archive_pathname ) && file_exists( $archive_pathname ) ) {