Fix file upload in international charsets (Farsi)

This commit is contained in:
Nathan Gray 2013-08-13 16:24:12 +00:00
parent 26ddd1bfaa
commit eade44ec57

View File

@ -140,7 +140,9 @@ class etemplate_widget_file extends etemplate_widget
// Data to send back to client
$temp_name = basename($file['tmp_name']);
$file_data[$temp_name] = array(
'name' => basename($file['name']),
// Prepend space to avoid UTF8 issues, from
// http://www.php.net/manual/en/function.basename.php#109518
'name' => ltrim(basename(' '.$file['name'])),
'type' => $file['type']
);
}