Closed (duplicate)
Project:
Drupal core
Version:
6.19
Component:
upload.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2009 at 11:17 UTC
Updated:
3 Sep 2010 at 08:43 UTC
Hello,
Function file_save_upload() uses basename() function for file name extraction:
$file->filename = file_munge_filename(trim(basename($_FILES['files']['name'][$source]), '.'), $extensions);
But basename() function isn't UTF-8 safe and basename() is returning blank results for strings with multibyte characters (http://php.net/basename).
And it makes it impossible to work with files like 'тест.jpg' (with no ASCII symbols) - Drupal can not identify file extension, filename becomes 'jpg.', uploaded images are not shown and so on.
I think, that file name is a user input and it should not influence on file processing.
Comments
Comment #1
kylehase commentedI can confirm this bug as I just ran into it as well on 6.19
Comment #2
damien tournoud commentedThis is most certainly a duplicate of #278425: Using basename() is not locale safe.