Privacy: Do not attempt to cleanup personal data export files when the directory does not exist.
Checking for the presence of the directory and returning early prevents PHP warnings when attempting to list files in a non-existent directory. Props arena, garrett-eclipse. Fixes #45136. git-svn-id: https://develop.svn.wordpress.org/trunk@44910 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
152e9d2b8f
commit
4db5347299
|
@ -6712,9 +6712,12 @@ function wp_schedule_delete_old_privacy_export_files() {
|
|||
* @since 4.9.6
|
||||
*/
|
||||
function wp_privacy_delete_old_export_files() {
|
||||
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
||||
|
||||
$exports_dir = wp_privacy_exports_dir();
|
||||
if ( ! is_dir( $exports_dir ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
||||
$export_files = list_files( $exports_dir, 100, array( 'index.html' ) );
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue