Make WordPress Core

Ticket #44195: 44195.3.diff

File 44195.3.diff, 1.3 KB (added by audrasjb, 8 years ago)

Replace index.html with index.php in clean up function wp_privacy_delete_old_export_files()

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

    diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
    index 4535684..935c12f 100644
    a b function wp_privacy_generate_personal_data_export_file( $request_id ) {  
    20312031        }
    20322032
    20332033        // Protect export folder from browsing.
    2034         $index_pathname = $exports_dir . 'index.html';
     2034        $index_pathname = $exports_dir . 'index.php';
    20352035        if ( ! file_exists( $index_pathname ) ) {
    20362036                $file = fopen( $index_pathname, 'w' );
    20372037                if ( false === $file ) {
    20382038                        wp_send_json_error( __( 'Unable to protect export folder from browsing.' ) );
    20392039                }
    2040                 fwrite( $file, 'Silence is golden.' );
     2040                fwrite( $file, "<?php \n");
     2041                fwrite( $file, "// Silence is golden." );
    20412042                fclose( $file );
    20422043        }
    20432044
  • src/wp-includes/functions.php

    diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
    index 60229ee..29c6c5d 100644
    a b function wp_privacy_delete_old_export_files() {  
    63246324        require_once( ABSPATH . 'wp-admin/includes/file.php' );
    63256325
    63266326        $exports_dir  = wp_privacy_exports_dir();
    6327         $export_files = list_files( $exports_dir, 100, array( 'index.html' ) );
     6327        $export_files = list_files( $exports_dir, 100, array( 'index.php' ) );
    63286328
    63296329        /**
    63306330         * Filters the lifetime, in seconds, of a personal data export file.