Merge pull request #11544 from atm-josselin/FIX_upload_file_with_multiple_spaces
FIX : correct error in files with multiple spaces
This commit is contained in:
commit
e8932335aa
@ -1540,6 +1540,11 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
||||
$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);
|
||||
|
||||
if (is_numeric($resupload) && $resupload > 0) // $resupload can be 'ErrorFileAlreadyExists'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user