Update um-file-upload.php

to prevent overwrite of multiple file uploads with the same name, I've added the $id to the filename just prior to the sanitize_file_name() call.
This commit is contained in:
jabourne
2017-01-19 02:45:56 -07:00
committed by GitHub
parent fdf3cc0e79
commit 7aa9dbbbee
+2 -2
View File
@@ -38,7 +38,7 @@ if(isset($_FILES[$id]['name'])) {
if(!is_array($_FILES[$id]['name'])) {
$temp = $_FILES[$id]["tmp_name"];
$file = $_FILES[$id]["name"];
$file = $id."-".$_FILES[$id]["name"];
$file = sanitize_file_name($file);
$extension = strtolower( pathinfo($file, PATHINFO_EXTENSION) );
@@ -57,4 +57,4 @@ if(isset($_FILES[$id]['name'])) {
} else {
$ret['error'] = __('A theme or plugin compatibility issue','ultimatemember');
}
echo json_encode($ret);
echo json_encode($ret);