WordPress.org

Make WordPress Core

Changeset 44910


Ignore:
Timestamp:
03/15/2019 06:59:14 PM (6 weeks ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r44829 r44910  
    67136713 */
    67146714function wp_privacy_delete_old_export_files() {
     6715    $exports_dir = wp_privacy_exports_dir();
     6716    if ( ! is_dir( $exports_dir ) ) {
     6717        return;
     6718    }
     6719
    67156720    require_once( ABSPATH . 'wp-admin/includes/file.php' );
    6716 
    6717     $exports_dir  = wp_privacy_exports_dir();
    67186721    $export_files = list_files( $exports_dir, 100, array( 'index.html' ) );
    67196722
Note: See TracChangeset for help on using the changeset viewer.