Skip to content

Commit

Permalink
Media: improve error messages for unsupported uploads.
Browse files Browse the repository at this point in the history
Improve language explaining the reason for failure when uploading a modern image format like WebP or AVIF that the server doesn’t handle.

Props adamsilverstein, Cybr.
Fixes #61361.



git-svn-id: https://develop.svn.wordpress.org/trunk@59590 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
adamsilverstein committed Jan 7, 2025
1 parent 082f6e6 commit 09459f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ function wp_default_scripts( $scripts ) {
/* translators: %s: File name. */
'file_exceeds_size_limit' => __( '%s exceeds the maximum upload size for this site.' ),
'zero_byte_file' => __( 'This file is empty. Please try another.' ),
'invalid_filetype' => __( 'Sorry, you are not allowed to upload this file type.' ),
'invalid_filetype' => __( 'This file cannot be processed by the web server.' ),
'not_an_image' => __( 'This file is not an image. Please try another.' ),
'image_memory_exceeded' => __( 'Memory exceeded. Please try another smaller file.' ),
'image_dimensions_exceeded' => __( 'This is larger than the maximum size. Please try another.' ),
Expand All @@ -1007,7 +1007,7 @@ function wp_default_scripts( $scripts ) {
/* translators: %s: File name. */
'error_uploading' => __( '“%s” has failed to upload.' ),
'unsupported_image' => __( 'This image cannot be displayed in a web browser. For best results convert it to JPEG before uploading.' ),
'noneditable_image' => __( 'This image cannot be processed by the web server. Convert it to JPEG or PNG before uploading.' ),
'noneditable_image' => __( 'The web server cannot generate responsive image sizes for this image. Convert it to JPEG or PNG before uploading.' ),
'file_url_copied' => __( 'The file URL has been copied to your clipboard' ),
);

Expand Down

0 comments on commit 09459f1

Please sign in to comment.