diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
index 4535684..62c8448 100644
|
a
|
b
|
function wp_privacy_generate_personal_data_export_file( $request_id ) {
|
| 2030 | 2030 | wp_send_json_error( __( 'Unable to create export folder.' ) ); |
| 2031 | 2031 | } |
| 2032 | 2032 | |
| 2033 | | // Protect export folder from browsing. |
| 2034 | | $index_pathname = $exports_dir . 'index.html'; |
| | 2033 | // Protect export folder from browsing and delete legacy index.html file. |
| | 2034 | $legacy_index_pathname = $exports_dir . 'index.html'; |
| | 2035 | $index_pathname = $exports_dir . 'index.php'; |
| | 2036 | if ( file_exists( $legacy_index_pathname ) ) { |
| | 2037 | unlink( $legacy_index_pathname ); |
| | 2038 | } |
| 2035 | 2039 | if ( ! file_exists( $index_pathname ) ) { |
| 2036 | 2040 | $file = fopen( $index_pathname, 'w' ); |
| 2037 | 2041 | if ( false === $file ) { |
| 2038 | 2042 | wp_send_json_error( __( 'Unable to protect export folder from browsing.' ) ); |
| 2039 | 2043 | } |
| 2040 | | fwrite( $file, 'Silence is golden.' ); |
| | 2044 | fwrite( $file, "<?php \n"); |
| | 2045 | fwrite( $file, "// Silence is golden." ); |
| 2041 | 2046 | fclose( $file ); |
| 2042 | 2047 | } |
| 2043 | 2048 | |