[wp-trac] [WordPress Trac] #54190: sanitize_file_name disallows acute accents and left smart apostrophe

WordPress Trac noreply at wordpress.org
Wed Aug 30 21:35:26 UTC 2023


#54190: sanitize_file_name disallows acute accents and left smart apostrophe
---------------------------------------------+---------------------
 Reporter:  jdorner                          |       Owner:  (none)
     Type:  defect (bug)                     |      Status:  new
 Priority:  normal                           |   Milestone:  6.4
Component:  Media                            |     Version:  5.5
 Severity:  normal                           |  Resolution:
 Keywords:  dev-feedback needs-testing-info  |     Focuses:
---------------------------------------------+---------------------

Comment (by Presskopp):

 `sanitize_file_name()` claims:

 "**not** to guarantee that this function will return a filename that is
 allowed to be uploaded."

 So it is not complete 'by design'.

 But let's think about adding some more chars like in:

 {{{#!php
 $special_chars = array(
         '?', '[', ']', '/', '\\', '=', '<', '>', ':', ';', ',', "'", '"',
 '&', '$',
         '#', '*', '(', ')', '|', '~', '`', '!', '{', '}', '%', '+', '’',
 '«', '»',
         '”', '“', chr( 0 ), '´', '^', '@', '%', '&', '*', '+', '=', '|',
 '{', '}',
         '(', ')', '[', ']', '<', '>', ',', ':', ';', '"', '\'', '~', '`',
 '#', '$',
         '£', '€', '¥', '¦', '§', '¨', '©', 'ª', '¬', '®', '¯', '°', '±',
 '²', '³',
         'µ', '¶', '·', '¸', '¹', 'º', '¼', '½', '¾', '¿', '×', '÷'
 );

 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54190#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list