From 35f94eb211aab7a1fc74ed8e6e9803b513df0719 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 21 May 2018 11:59:24 +0000 Subject: [PATCH] Privacy: Correct the error check when creating an export folder in `wp_privacy_generate_personal_data_export_file()`. `wp_mkdir_p()` returns `false` on error, not a `WP_Error` object. Props birgire. Fixes #44158. Built from https://develop.svn.wordpress.org/trunk@43299 git-svn-id: http://core.svn.wordpress.org/trunk@43128 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/file.php | 5 ++--- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index b00752e095..dd528617e2 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -2026,9 +2026,8 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { $exports_dir = wp_privacy_exports_dir(); $exports_url = wp_privacy_exports_url(); - $result = wp_mkdir_p( $exports_dir ); - if ( is_wp_error( $result ) ) { - wp_send_json_error( $result->get_error_message() ); + if ( ! wp_mkdir_p( $exports_dir ) ) { + wp_send_json_error( __( 'Unable to create export folder.' ) ); } // Protect export folder from browsing. diff --git a/wp-includes/version.php b/wp-includes/version.php index 932424c350..23ae0840f4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43293'; +$wp_version = '5.0-alpha-43299'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.