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

kylehase’s picture

Version: 6.10 » 6.19

I can confirm this bug as I just ran into it as well on 6.19

damien tournoud’s picture

Status: Active » Closed (duplicate)

This is most certainly a duplicate of #278425: Using basename() is not locale safe.