WordPress.org

Make WordPress Core

Changeset 43097


Ignore:
Timestamp:
05/02/2018 02:37:50 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Privacy: Include wp-admin/includes/file.php to avoid fatal error.

list_files() is defined in wp-admin/includes/file.php, which is not included by wp-cron.php, so it needs to be included by the caller in order to avoid a fatal PHP error.

This bug was not detected during testing because the file _is_ included when executing jobs via wp cron event run.

Props mikejolley, iandunn.
Merges [43059] to the 4.9 branch.
See #43546.
See https://wordpress.slack.com/archives/C9695RJBW/p1525190405000860.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/functions.php

    r43095 r43097  
    59595959 */
    59605960function wp_privacy_delete_old_export_files() {
     5961    require_once( ABSPATH . 'wp-admin/includes/file.php' );
     5962
    59615963    $upload_dir   = wp_upload_dir();
    59625964    $exports_dir  = trailingslashit( $upload_dir['basedir'] . '/exports' );
Note: See TracChangeset for help on using the changeset viewer.