FIX more bugs and warnings

This commit is contained in:
Regis Houssin 2025-02-04 04:54:54 +01:00
parent ecf1d2553b
commit 3da1c1c843
3 changed files with 5 additions and 6 deletions

View File

@ -1562,7 +1562,9 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
}
}
} else {
$ok = false; // to avoid false positive
if (empty($nophperrors)) {
$ok = false; // to avoid false positive
}
dol_syslog("No files to delete found", LOG_DEBUG);
}
} else {

View File

@ -603,10 +603,7 @@ class modAgenda extends DolibarrModules
// Permissions
$this->remove($options);
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type='member' AND entity = ".((int) $conf->entity),
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','member',".((int) $conf->entity).")"
);
$sql = array();
return $this->_init($sql, $options);
}

View File

@ -4135,7 +4135,7 @@ function migrate_delete_old_files($db, $langs, $conf)
//print '<b>'DOL_DOCUMENT_ROOT.$filetodelete."</b><br>\n";
if (preg_match('/\*/', $filetodelete) || file_exists(DOL_DOCUMENT_ROOT.$filetodelete)) {
//print "Process file ".$filetodelete."\n";
$result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, 0, 0, null, true, false);
$result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, 1, 0, null, true, false); // nophperrors to avoid false positive with asterisk
if (!$result) {
$langs->load("errors");
print '<div class="error">'.$langs->trans("Error").': '.$langs->trans("ErrorFailToDeleteFile", DOL_DOCUMENT_ROOT.$filetodelete);