Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#53575 reopened defect (bug)

Filename creation with special characters fails

Reported by: mac79's profile mac79 Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.7.2
Component: Upload Keywords:
Focuses: Cc:

Description

Hi,

when uploading a file which name contains a left and right double quotation mark, e. g. „Test“.pdf, WordPress will remove the left double quotation mark in the names of the generated files:

  • „Test.pdf
  • „Test-pdf.jpg
  • „Test-pdf-106x150.jpg
  • etc.

When I look into my media store I can see older uploads where this issue didn't occur. So I think it's a new bug.

BR,
Mac

Change History (2)

#1 @azaozz
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Hi @mac79, thanks for the bug report.

File names with special characters are a bit tricky. WordPress tries to sanitize them so they are compatible with all OS (MacOS, Windows, Linux, Android, iOS, etc.), all languages/locales, and with web use/HTML.

The last change to the list of illegal characters that added curly quotes was about a year ago, see #50231. Also see https://developer.wordpress.org/reference/functions/sanitize_file_name/ for the whole list. Best would be to rename your files before uploading and avoid these chars.

Closing as worksforme as this is a feature, not a bug. If you believe the patch on #50231 should be reverted feel free to reopen this ticket with reasons, examples, etc.

#2 @mac79
3 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Hi again,

ok, I understand why there should be a sanatize functionality but why does it ignore the „ character then?

BR,
Mac

Note: See TracTickets for help on using tickets.