[wp-trac] Re: [WordPress Trac] #9416: Better file name sanitization for wp_unique_filename

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 21 00:49:27 GMT 2009


#9416: Better file name sanitization for wp_unique_filename
-------------------------+--------------------------------------------------
 Reporter:  sivel        |       Owner:  sivel      
     Type:  enhancement  |      Status:  assigned   
 Priority:  normal       |   Milestone:  2.8        
Component:  Upload       |     Version:  2.7.1      
 Severity:  normal       |    Keywords:  needs-patch
-------------------------+--------------------------------------------------

Comment(by sivel):

 As for the current sanitization it uses sanitize_title_with_dashes and
 part of this is removing periods from the filename other than the one
 before the file extension.  In addition I have also received complaints
 that wp_unique_filename converts filenames to all lower case.  Changing
 the way WordPress handles filename case should not cause issues with
 unique filenames.

 While talking to Ryan today he suggested that we start using a function to
 better facilitate sanitizing filenames rather than using a function
 intended for another use.

 There is already a function in wordpress sanitize_file_name that can be
 used here but may need some updating as it won't work properly with non
 ASCII filenames.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9416#comment:18>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list