Make WordPress Core


Ignore:
Timestamp:
01/27/2021 11:45:29 PM (5 years ago)
Author:
whyisjake
Message:

Privacy: Ensure that exported user data reports can't be found with directory listings.

By moving from .html to .php files, we can prevent directory listings, and ensure that WordPress can load.

Fixes #52299.

Props lucasbustamante, xkon, freewebmentor, SergeyBiryukov, whyisjake.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/privacy-tools.php

    r49970 r50037  
    323323
    324324    // Protect export folder from browsing.
    325     $index_pathname = $exports_dir . 'index.html';
     325    $index_pathname = $exports_dir . 'index.php';
    326326    if ( ! file_exists( $index_pathname ) ) {
    327327        $file = fopen( $index_pathname, 'w' );
     
    329329            wp_send_json_error( __( 'Unable to protect personal data export folder from browsing.' ) );
    330330        }
    331         fwrite( $file, '<!-- Silence is golden. -->' );
     331        fwrite( $file, '<?php // Silence is golden.' );
    332332        fclose( $file );
    333333    }
Note: See TracChangeset for help on using the changeset viewer.