Skip to content

Commit 3075eeb

Browse files
committed
Dropbox: Security: Sanitize file name that could import document with special characters - refs BT#22273
1 parent 406e0dd commit 3075eeb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main/inc/ajax/dropbox.ajax.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@
8282
foreach ($fileList as $file) {
8383
if (isset($_REQUEST['chunkAction']) && 'done' === $_REQUEST['chunkAction']) {
8484
// to rename and move the finished file
85-
$chunkedFile = api_get_path(SYS_ARCHIVE_PATH).$file['name'];
85+
$tmpFile = disable_dangerous_file(
86+
api_replace_dangerous_char($file['name'])
87+
);
88+
89+
// to rename and move the finished file
90+
$chunkedFile = api_get_path(SYS_ARCHIVE_PATH).$tmpFile;
8691
$file['tmp_name'] = $chunkedFile;
8792
$file['size'] = filesize($chunkedFile);
8893
$file['copy_file'] = true;

0 commit comments

Comments
 (0)