forked from Wavyzz/dolibarr
@@ -103,7 +103,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|||||||
$ret = dol_delete_file($file, 0, 0, 0, (is_object($object) ? $object : null));
|
$ret = dol_delete_file($file, 0, 0, 0, (is_object($object) ? $object : null));
|
||||||
if (!empty($fileold)) dol_delete_file($fileold, 0, 0, 0, (is_object($object) ? $object : null)); // Delete file using old path
|
if (!empty($fileold)) dol_delete_file($fileold, 0, 0, 0, (is_object($object) ? $object : null)); // Delete file using old path
|
||||||
|
|
||||||
// Si elle existe, on efface la vignette
|
// If it exists, remove thumb.
|
||||||
|
$regs = array();
|
||||||
if (preg_match('/(\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff)$/i', $file, $regs))
|
if (preg_match('/(\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff)$/i', $file, $regs))
|
||||||
{
|
{
|
||||||
$photo_vignette = basename(preg_replace('/'.$regs[0].'/i', '', $file).'_small'.$regs[0]);
|
$photo_vignette = basename(preg_replace('/'.$regs[0].'/i', '', $file).'_small'.$regs[0]);
|
||||||
@@ -124,9 +125,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", $urlfile), null, 'errors');
|
setEventMessages($langs->trans("ErrorFailToDeleteFile", $urlfile), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
} elseif ($linkid) { // delete of external link
|
||||||
elseif ($linkid) // delete of external link
|
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||||
$link = new Link($db);
|
$link = new Link($db);
|
||||||
$link->fetch($linkid);
|
$link->fetch($linkid);
|
||||||
@@ -190,6 +189,10 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha'))
|
|||||||
$filenamefrom = dol_sanitizeFileName(GETPOST('renamefilefrom', 'alpha'), '_', 0); // Do not remove accents
|
$filenamefrom = dol_sanitizeFileName(GETPOST('renamefilefrom', 'alpha'), '_', 0); // Do not remove accents
|
||||||
$filenameto = dol_sanitizeFileName(GETPOST('renamefileto', 'alpha'), '_', 0); // Do not remove accents
|
$filenameto = dol_sanitizeFileName(GETPOST('renamefileto', 'alpha'), '_', 0); // Do not remove accents
|
||||||
|
|
||||||
|
// We apply dol_string_nohtmltag also to clean file names (this remove duplicate spaces) because
|
||||||
|
// this function is also applied when we upload and when we make try to download file (by the GETPOST(filename, 'alphanohtml') call).
|
||||||
|
$filenameto = dol_string_nohtmltag($filenameto);
|
||||||
|
|
||||||
if ($filenamefrom != $filenameto)
|
if ($filenamefrom != $filenameto)
|
||||||
{
|
{
|
||||||
// Security:
|
// Security:
|
||||||
|
|||||||
@@ -1592,7 +1592,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
|
|||||||
$destfile = dol_sanitizeFileName($info['filename'].($info['extension'] != '' ? ('.'.strtolower($info['extension'])) : ''));
|
$destfile = dol_sanitizeFileName($info['filename'].($info['extension'] != '' ? ('.'.strtolower($info['extension'])) : ''));
|
||||||
|
|
||||||
// We apply dol_string_nohtmltag also to clean file names (this remove duplicate spaces) because
|
// 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).
|
// this function is also applied when we rename and when we make try to download file (by the GETPOST(filename, 'alphanohtml') call).
|
||||||
$destfile = dol_string_nohtmltag($destfile);
|
$destfile = dol_string_nohtmltag($destfile);
|
||||||
$destfull = dol_string_nohtmltag($destfull);
|
$destfull = dol_string_nohtmltag($destfull);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user