Ticket #52299: 52299.diff
File 52299.diff, 2.7 KB (added by , 4 years ago) |
---|
-
src/wp-admin/includes/privacy-tools.php
322 322 } 323 323 324 324 // Protect export folder from browsing. 325 $index_pathname = $exports_dir . 'index. html';325 $index_pathname = $exports_dir . 'index.php'; 326 326 if ( ! file_exists( $index_pathname ) ) { 327 327 $file = fopen( $index_pathname, 'w' ); 328 328 if ( false === $file ) { 329 329 wp_send_json_error( __( 'Unable to protect personal data export folder from browsing.' ) ); 330 330 } 331 fwrite( $file, '< !-- Silence is golden. -->' );331 fwrite( $file, '<?php // Silence is golden.' ); 332 332 fclose( $file ); 333 333 } 334 334 -
src/wp-includes/functions.php
7398 7398 } 7399 7399 7400 7400 require_once ABSPATH . 'wp-admin/includes/file.php'; 7401 $export_files = list_files( $exports_dir, 100, array( 'index. html' ) );7401 $export_files = list_files( $exports_dir, 100, array( 'index.php' ) ); 7402 7402 7403 7403 /** 7404 7404 * Filters the lifetime, in seconds, of a personal data export file. -
tests/phpunit/tests/privacy/wpPrivacyDeleteOldExportFiles.php
55 55 wp_mkdir_p( $exports_dir ); 56 56 } 57 57 58 self::$index_path = $exports_dir . 'index. html';58 self::$index_path = $exports_dir . 'index.php'; 59 59 self::$expired_export_file = $exports_dir . 'wp-personal-data-file-0123456789abcdef.zip'; 60 60 self::$active_export_file = $exports_dir . 'wp-personal-data-file-fedcba9876543210.zip'; 61 61 } -
tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php
214 214 } 215 215 216 216 /** 217 * Test that an index. htmlfile can be added to the export directory.217 * Test that an index.php file can be added to the export directory. 218 218 * 219 219 * @ticket 44233 220 220 */ … … 222 222 $this->expectOutputString( '' ); 223 223 wp_privacy_generate_personal_data_export_file( self::$export_request_id ); 224 224 225 $this->assertTrue( file_exists( self::$exports_dir . 'index. html' ) );225 $this->assertTrue( file_exists( self::$exports_dir . 'index.php' ) ); 226 226 } 227 227 228 228 /**