Make WordPress Core

Opened 3 years ago

Closed 17 months ago

#33242 closed defect (bug) (fixed)

Invalid file type - similar strings

Reported by: pavelevap Owned by: SergeyBiryukov
Milestone: 4.8 Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch
Focuses: Cc:


We have 3 very similar strings which are used for same error:

Invalid file type
This file type is not allowed. Please try another.
Sorry, this file type is not permitted for security reasons.

I do not see any reason why we should preserve them all? I can create patch, but I am not sure which one is the best? Maybe some simple combination like "Sorry, this file type is not allowed."?

Attachments (1)

33242.diff (2.1 KB) - added by jackreichert 19 months ago.
Proposed language change implementation.

Download all attachments as: .zip

Change History (10)

#1 @DrewAPicture
3 years ago

  • Keywords needs-patch added

This ticket was mentioned in Slack in #core by obenland. View the logs.

3 years ago

#3 @ocean90
3 years ago

  • Component changed from I18N to Media
  • Version trunk deleted

#4 @swissspidy
3 years ago

All three strings are used in different contexts:

  • Invalid file type is used as an error message in wp_upload_bits
  • This file type is not allowed. Please try another. is used as an error message for the flash uploader. Most error messages there have the Please try another. ending.
  • Sorry, this file type is not permitted for security reasons. is used in _wp_handle_upload

At best merging strings 1 and 3 would make sense in my opinion.

#5 @pavelevap
3 years ago

Yes, different functions, but users should know the same thing for all cases: "This file type is not allowed". I do not see a reason to tell them that it can be "invalid", "not allowed" or "not permitted".

I would ignore "Please try another" part, because it is not exact. Another what? Filetype or file?

"Sorry, this file type is not allowed to upload." or something similar could be enough for all cases.

#6 @wonderboymusic
3 years ago

  • Milestone changed from Awaiting Review to Future Release

19 months ago

Proposed language change implementation.

#7 @jackreichert
19 months ago

  • Keywords has-patch added; needs-patch removed

#8 @SergeyBiryukov
17 months ago

  • Milestone changed from Future Release to 4.8

#9 @SergeyBiryukov
17 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 39891:

Media: Use a consistent error message for file type errors on uploading.

Props pavelevap, jackreichert.
Fixes #33242.

Note: See TracTickets for help on using tickets.