@@ -469,7 +469,7 @@ protected function upcount_name($name) {
469469 1
470470 );
471471 }
472-
472+
473473 protected function sanitizeFileName ($ file ) {
474474 // (|\\?*<\":>+[]/')
475475 // \|\\\?\*\<\"\'\:\>\+\[\]
@@ -560,6 +560,25 @@ protected function get_file_name($file_path, $name, $size, $type, $error,
560560 );
561561 }
562562
563+ protected function get_current_file_name ($ file_path , $ name , $ size , $ type , $ error ,
564+ $ index , $ content_range ) {
565+
566+ $ name = $ this ->trim_file_name ($ file_path , $ name , $ size , $ type , $ error , $ index , $ content_range );
567+
568+
569+ return $ this ->get_unique_filename (
570+ $ file_path ,
571+ $ this ->fix_file_extension ($ file_path , $ name , $ size , $ type , $ error ,
572+ $ index , $ content_range ),
573+ $ size ,
574+ $ type ,
575+ $ error ,
576+ $ index ,
577+ $ content_range
578+ );
579+ }
580+
581+
563582 protected function handle_form_data ($ file , $ index ) {
564583 // Handle form data, e.g. $_REQUEST['description'][$index]
565584 }
@@ -1079,8 +1098,13 @@ protected function handle_file_upload($uploaded_file, $name, $size, $type, $erro
10791098 $ index = null , $ content_range = null ) {
10801099
10811100 $ file = new \stdClass ();
1082- $ file ->name = $ this ->get_file_name ($ uploaded_file , $ name , $ size , $ type , $ error ,
1083- $ index , $ content_range );
1101+ // $file->name = $this->get_file_name($uploaded_file, $name, $size, $type, $error,
1102+ // $index, $content_range);
1103+
1104+ $ file ->name = $ this ->trim_file_name ($ uploaded_path , $ name , $ size , $ type , $ error , $ index , $ content_range );
1105+ $ file ->name = $ this ->fix_file_extension ($ uploaded_path , $ name , $ size , $ type , $ error , $ index , $ content_range );
1106+
1107+
10841108 $ file ->size = $ this ->fix_integer_overflow (intval ($ size ));
10851109 $ file ->type = $ type ;
10861110 if ($ this ->validate ($ uploaded_file , $ file , $ error , $ index )) {
@@ -1103,7 +1127,7 @@ protected function handle_file_upload($uploaded_file, $name, $size, $type, $erro
11031127 } else {
11041128 chmod ($ uploaded_file , 0644 );
11051129// move_uploaded_file($uploaded_file, $file_path);
1106- exec (VESTA_CMD . "v-copy-fs-file " . USERNAME ." {$ uploaded_file } {$ file_path }" , $ output , $ return_var );
1130+ exec (VESTA_CMD . "v-copy-fs-file " . USERNAME ." {$ uploaded_file } ' {$ file_path }' " , $ output , $ return_var );
11071131
11081132 $ error = check_return_code ($ return_var , $ output );
11091133 if ($ return_var != 0 ) {
0 commit comments