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.
Built from https://develop.svn.wordpress.org/branches/4.9@43097


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-05-02 02:38:25 +00:00
parent 894cec5697
commit df15be7cf9
2 changed files with 3 additions and 1 deletions

View File

@ -5958,6 +5958,8 @@ 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' );
$upload_dir = wp_upload_dir();
$exports_dir = trailingslashit( $upload_dir['basedir'] . '/exports' );
$export_files = list_files( $exports_dir, 100, array( 'index.html' ) );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9.6-alpha-43096';
$wp_version = '4.9.6-alpha-43097';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.