WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 2 months ago

#54190 new defect (bug)

sanitize_file_name disallows acute accents and left smart apostrophe

Reported by: jdorner Owned by:
Milestone: Awaiting Review 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 2 months ago.
file with acute accent in the filename - unable to upload to media library

Download all attachments as: .zip

Change History (7)

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


2 months ago

#4 @justinahinon
2 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
2 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
2 months ago

  • Description modified (diff)

@jdorner
2 months ago

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

Note: See TracTickets for help on using tickets.