Make WordPress Core


Ignore:
Timestamp:
05/01/2018 05:42:50 PM (7 years ago)
Author:
iandunn
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.
See #43546.
See https://wordpress.slack.com/archives/C9695RJBW/p1525190405000860.

File:
1 edited

Legend:

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

    r43046 r43059  
    62826282 */
    62836283function wp_privacy_delete_old_export_files() {
     6284    require_once( ABSPATH . 'wp-admin/includes/file.php' );
     6285
    62846286    $upload_dir   = wp_upload_dir();
    62856287    $exports_dir  = trailingslashit( $upload_dir['basedir'] . '/exports' );
Note: See TracChangeset for help on using the changeset viewer.