From c67d79a4e2ece3a0b87b752c05577629d3aacec1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 May 2019 12:00:13 +0200 Subject: [PATCH] Update files.lib.php --- htdocs/core/lib/files.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8a1fecd999a..3e7e2796eca 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -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);