Make WordPress Core

Opened 21 months ago

Last modified 3 months ago

#54190 new defect (bug)

sanitize_file_name disallows acute accents and left smart apostrophe

Reported by: jdorner's profile jdorner Owned by:
Milestone: 6.3 Priority: normal
Severity: normal Version: 5.5
Component: Media Keywords: dev-feedback reporter-feedback needs-testing-info
Focuses: Cc:

Description (last modified by sabernhardt)

The following change to line 1991 of wp-includes/formatting.php will disallow acute accents and left smart apostrophe in file names

$special_chars = array( '?', '[', ']', '/', '\\', '=', '<', '>', ':', ';', ',', "'", '"', '&', '$', '#', '*', '(', ')', '|', '~', '`', '´', '!', '{', '}', '%', '+', 'ʻ','’', '«', '»', '”', '“', chr( 0 ) );

Attachments (1)

test´filename.txt (2.7 KB) - added by jdorner 20 months ago.
file with acute accent in the filename - unable to upload to media library

Download all attachments as: .zip

Change History (10)

#1 @jdorner
21 months ago

After further review, should all extended ASCII codes (character code 128-255) be excluded or are these valid in a URL?

#2 @hellofromTonya
20 months ago

  • Component changed from General to Media
  • Summary changed from sanitize_file_name allows acute accents and left smart apostrophe to sanitize_file_name disallows acute accents and left smart apostrophe
  • Version changed from 5.8.1 to 5.5

Hello @jdorner,

Welcome to WordPress Core's Trac! Thank you for reporting this.

Adding contextual information:
This change was introduced in changeset [48596] for ticket #50231 in the 5.5 release as part of the Media component. Updated ticket information.

This ticket was mentioned in Slack in #core-test by hellofromtonya. View the logs.


20 months ago

#4 @justinahinon
20 months ago

  • Keywords dev-feedback added

Thanks for opening the ticket @jdorner.

I think we might need some additional information from the media team about the policy for filenames.

Adding a keyword and pinging a component maintainer.
cc @mikeschroder

#5 @mai21
20 months ago

  • Keywords reporter-feedback needs-testing-info added

@jdorner Can you please provide a use case or step-by-step instructions on how to reproduce the issue?

Thanks

#6 @sabernhardt
20 months ago

  • Description modified (diff)

@jdorner
20 months ago

file with acute accent in the filename - unable to upload to media library

#7 @lukefiretoss
17 months ago

Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels.

Is the message that shows in the media library if an image is being uploaded that contains an apostrophe in the file name.

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


3 months ago

#9 @antpb
3 months ago

  • Milestone changed from Awaiting Review to 6.3

Moving to 6.3 to investigate if this is still valid and what needs to happen.

Note: See TracTickets for help on using tickets.