From 667f26b3afe4b8e5b1e572bf7f64932792d1afd7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 6 Jan 2020 16:16:03 +0000 Subject: [PATCH] I18N: Replace `php.ini`, `post_max_size`, and `upload_max_filesize` with placeholders in "File is empty" error message. Props ramiy. Fixes #48868. Built from https://develop.svn.wordpress.org/trunk@47043 git-svn-id: http://core.svn.wordpress.org/trunk@46843 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/file.php | 8 +++++++- wp-admin/includes/import.php | 8 +++++++- wp-includes/version.php | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index a47fd79826..a28ac46098 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -804,7 +804,13 @@ function _wp_handle_upload( &$file, $overrides, $time, $action ) { if ( is_multisite() ) { $error_msg = __( 'File is empty. Please upload something more substantial.' ); } else { - $error_msg = __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ); + $error_msg = sprintf( + /* translators: 1: php.ini, 2: post_max_size, 3: upload_max_filesize */ + __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your %1$s file or by %2$s being defined as smaller than %3$s in %1$s.' ), + 'php.ini', + 'post_max_size', + 'upload_max_filesize' + ); } return call_user_func_array( $upload_error_handler, array( &$file, $error_msg ) ); } diff --git a/wp-admin/includes/import.php b/wp-admin/includes/import.php index 7b6ff88641..27aa8aa4f2 100644 --- a/wp-admin/includes/import.php +++ b/wp-admin/includes/import.php @@ -82,7 +82,13 @@ function wp_import_cleanup( $id ) { function wp_import_handle_upload() { if ( ! isset( $_FILES['import'] ) ) { return array( - 'error' => __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ), + 'error' => sprintf( + /* translators: 1: php.ini, 2: post_max_size, 3: upload_max_filesize */ + __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your %1$s file or by %2$s being defined as smaller than %3$s in %1$s.' ), + 'php.ini', + 'post_max_size', + 'upload_max_filesize' + ), ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index a0234ccc68..b9b9e28257 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-47042'; +$wp_version = '5.4-alpha-47043'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.