Update files.lib.php

This commit is contained in:
Laurent Destailleur 2019-05-13 12:00:13 +02:00 committed by GitHub
parent f661b926fa
commit c67d79a4e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1556,6 +1556,8 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
$destfull = $info['dirname'].'/'.dol_sanitizeFileName($info['filename'].'.'.strtolower($info['extension']));
$info = pathinfo($destfile);
$destfile = dol_sanitizeFileName($info['filename'].'.'.strtolower($info['extension']));
// We apply dol_string_nohtmltag also to clean file names (this remove duplicate spaces) because
// this function is also applied when we make try to download file (by the GETPOST(filename, 'alphanohtml') call).
$destfile = dol_string_nohtmltag($destfile);
$destfull = dol_string_nohtmltag($destfull);
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles);