From e75e49426f0ad7905627aa33f5ca354d8d34b2f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 31 Mar 2020 13:52:02 +0200 Subject: [PATCH] Look and feel v12 --- htdocs/core/class/html.formfile.class.php | 6 +++--- htdocs/core/lib/files.lib.php | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index e84feb90601..20c723ba8a2 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1387,7 +1387,7 @@ class FormFile if ($permtoeditline) { $paramsectiondir = (in_array($modulepart, array('medias', 'ecm')) ? '§ion_dir='.urlencode($relativepath) : ''); - print ''.img_edit('default', 0, 'class="paddingrightonly"').''; + print ''.img_edit('default', 0, 'class="paddingrightonly"').''; } } if ($permonobject) @@ -1879,9 +1879,9 @@ class FormFile print ''.dol_print_date($link->datea, "dayhour", "tzuser").''; print ''; print ''; - print ''.img_edit().''; // id= is included into $param + print ''.img_edit().''; // id= is included into $param if ($permissiontodelete) { - print '   '.img_delete().''; // id= is included into $param + print '   '.img_delete().''; // id= is included into $param } else { print ' '; } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 1cd80af55ed..7dafb316a18 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1545,11 +1545,13 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess // Define $destfull (path to file including filename) and $destfile (only filename) $destfull = $upload_dir."/".$TFile['name'][$i]; $destfile = $TFile['name'][$i]; + $destfilewithoutext = preg_replace('/\.[^\.]+$/', '', $destfile); - if ($savingdocmask) + if ($savingdocmask && strpos($savingdocmask, $destfilewithoutext) !== 0) { $destfull = $upload_dir."/".preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask); $destfile = preg_replace('/__file__/', $TFile['name'][$i], $savingdocmask); + } // dol_sanitizeFileName the file name and lowercase extension