I18N: Replace php.ini, post_max_size, and upload_max_filesize with placeholders in "File is empty" error message.

Props ramiy.
Fixes #48868.

git-svn-id: https://develop.svn.wordpress.org/trunk@47043 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-01-06 16:14:30 +00:00
parent 086ae28f0e
commit b459cddeaf
2 changed files with 14 additions and 2 deletions

View File

@ -804,7 +804,13 @@ function _wp_handle_upload( &$file, $overrides, $time, $action ) {
if ( is_multisite() ) { if ( is_multisite() ) {
$error_msg = __( 'File is empty. Please upload something more substantial.' ); $error_msg = __( 'File is empty. Please upload something more substantial.' );
} else { } 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 ) ); return call_user_func_array( $upload_error_handler, array( &$file, $error_msg ) );
} }

View File

@ -82,7 +82,13 @@ function wp_import_cleanup( $id ) {
function wp_import_handle_upload() { function wp_import_handle_upload() {
if ( ! isset( $_FILES['import'] ) ) { if ( ! isset( $_FILES['import'] ) ) {
return array( 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'
),
); );
} }