|
|
@@ -469,7 +469,7 @@ class UploadHandler
|
|
|
1
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
protected function sanitizeFileName($file) {
|
|
|
// (|\\?*<\":>+[]/')
|
|
|
// \|\\\?\*\<\"\'\:\>\+\[\]
|
|
|
@@ -560,6 +560,25 @@ class UploadHandler
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ protected function get_current_file_name($file_path, $name, $size, $type, $error,
|
|
|
+ $index, $content_range) {
|
|
|
+
|
|
|
+ $name = $this->trim_file_name($file_path, $name, $size, $type, $error, $index, $content_range);
|
|
|
+
|
|
|
+
|
|
|
+ return $this->get_unique_filename(
|
|
|
+ $file_path,
|
|
|
+ $this->fix_file_extension($file_path, $name, $size, $type, $error,
|
|
|
+ $index, $content_range),
|
|
|
+ $size,
|
|
|
+ $type,
|
|
|
+ $error,
|
|
|
+ $index,
|
|
|
+ $content_range
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
protected function handle_form_data($file, $index) {
|
|
|
// Handle form data, e.g. $_REQUEST['description'][$index]
|
|
|
}
|
|
|
@@ -1079,8 +1098,13 @@ class UploadHandler
|
|
|
$index = null, $content_range = null) {
|
|
|
|
|
|
$file = new \stdClass();
|
|
|
- $file->name = $this->get_file_name($uploaded_file, $name, $size, $type, $error,
|
|
|
- $index, $content_range);
|
|
|
+// $file->name = $this->get_file_name($uploaded_file, $name, $size, $type, $error,
|
|
|
+// $index, $content_range);
|
|
|
+
|
|
|
+ $file->name = $this->trim_file_name($uploaded_path, $name, $size, $type, $error, $index, $content_range);
|
|
|
+ $file->name = $this->fix_file_extension($uploaded_path, $name, $size, $type, $error, $index, $content_range);
|
|
|
+
|
|
|
+
|
|
|
$file->size = $this->fix_integer_overflow(intval($size));
|
|
|
$file->type = $type;
|
|
|
if ($this->validate($uploaded_file, $file, $error, $index)) {
|
|
|
@@ -1103,7 +1127,7 @@ class UploadHandler
|
|
|
} else {
|
|
|
chmod($uploaded_file, 0644);
|
|
|
// move_uploaded_file($uploaded_file, $file_path);
|
|
|
- exec (VESTA_CMD . "v-copy-fs-file ". USERNAME ." {$uploaded_file} {$file_path}", $output, $return_var);
|
|
|
+ exec (VESTA_CMD . "v-copy-fs-file ". USERNAME ." {$uploaded_file} '{$file_path}'", $output, $return_var);
|
|
|
|
|
|
$error = check_return_code($return_var, $output);
|
|
|
if ($return_var != 0) {
|