WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 2 months ago

#53575 closed defect (bug) (worksforme)

Filename creation with special characters fails

Reported by: 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 (1)

#1 @azaozz
2 months 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.

Note: See TracTickets for help on using tickets.