Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#53575 reopened defect (bug)

Filename creation with special characters fails

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

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
5 years ago

  • Milestone Awaiting Review
  • Resolutionworksforme
  • Status newclosed

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
5 years ago

  • Resolution worksforme
  • Status closedreopened

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.