From 9bb0e18c82ce5fdd9476a4550aabfeada49d55cf Mon Sep 17 00:00:00 2001 From: iandunn Date: Tue, 1 May 2018 17:43:22 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@43059 git-svn-id: http://core.svn.wordpress.org/trunk@42888 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 ++ wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 647e0db2d0..a1af5dbbcc 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -6281,6 +6281,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' ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 5861d95403..81d669d00f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43058'; +$wp_version = '5.0-alpha-43059'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.