[wp-trac] [WordPress Trac] #15955: move_uploaded_file mangles non-ascii characters on Windows platforms

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 11 04:50:59 UTC 2011


#15955: move_uploaded_file mangles non-ascii characters on Windows platforms
-------------------------------------+------------------------------
 Reporter:  t31os_                   |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Upload                   |     Version:  3.0.3
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+------------------------------

Comment (by solarissmoke):

 Replying to [comment:9 SergeyBiryukov]:
 > There's actually no problem with regular characters, just with some
 special ones, I guess.

 Problem is, depending on what encoding Windows is using, the special ones
 could be pretty much anything - chinese, arabic, indian characters, all of
 these would potentially fall over here.

 > Since we already have `remove_accents()` in `sanitize_title()`, perhaps
 we can use something similar in `sanitize_file_name()` too.

 `remove_accents()` looks like a throwback to the days when file names
 *had* to be ASCII - and when the list of non-ascii characters was small.
 Neither of those is true any more... I think there may actually be a case
 for removing it from `sanitize_title` at some point.

 IMO `sanitize_file_name` should only strip OS-reserved characters. The
 rest are legal - and it's only because of the PHP bug that it doesn't work
 on Windows.

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


More information about the wp-trac mailing list