Security: sanitize file name when uploading chunks with bigUpload

pull/4889/head
Angel Fernando Quiroz Campos 2 years ago
parent ed72914608
commit 3d74fb7d99
  1. 7
      main/inc/ajax/document.ajax.php

@ -59,9 +59,12 @@ switch ($action) {
} }
if (!empty($fileList)) { if (!empty($fileList)) {
foreach ($fileList as $n => $file) { foreach ($fileList as $n => $file) {
$tmpFile = $tempDirectory.$file['name']; $tmpFile = disable_dangerous_file(
api_replace_dangerous_char($file['name'])
);
file_put_contents( file_put_contents(
$tmpFile, $tempDirectory.$tmpFile,
fopen($file['tmp_name'], 'r'), fopen($file['tmp_name'], 'r'),
FILE_APPEND FILE_APPEND
); );

Loading…
Cancel
Save