diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 9021ccfa80b..cbf957d8bdd 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -111,23 +111,23 @@ class Utils } if ($choice == 'allfiles') { - // Delete all files (except install.lock, do not follow symbolic links) + // Delete all files (except .lock and .unlock files, do not follow symbolic links) if ($dolibarr_main_data_root) { - $filesarray = dol_dir_list($dolibarr_main_data_root, "all", 0, '', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1); // No need to use recursive, we will delete directory + $filesarray = dol_dir_list($dolibarr_main_data_root, "all", 0, '', '(\.lock|\.unlock)$', 'name', SORT_ASC, 0, 0, '', 1); // No need to use recursive, we will delete directory } } if ($choice == 'allfilesold') { - // Delete all files (except install.lock, do not follow symbolic links) + // Delete all files (except .lock and .unlock files, do not follow symbolic links) if ($dolibarr_main_data_root) { - $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 1, '', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1, $nbsecondsold); // No need to use recursive, we will delete directory + $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 1, '', '(\.lock|\.unlock)$', 'name', SORT_ASC, 0, 0, '', 1, $nbsecondsold); // No need to use recursive, we will delete directory } } if ($choice == 'logfile' || $choice == 'logfiles') { // Define files log if ($dolibarr_main_data_root) { - $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*(\.gz)?$', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1); + $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*(\.gz)?$', '(\.lock|\.unlock)$', 'name', SORT_ASC, 0, 0, '', 1); } if (isModEnabled('syslog')) { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5fc44e1fe02..039082c3583 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2633,10 +2633,9 @@ class Ticket extends CommonObject continue; } - if ($info_sendto['email'] != '') { - if (!empty($info_sendto['email'])) { - $sendto[] = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'])." <".$info_sendto['email'].">"; - } + // We check if the email address is not the assignee's address to prevent notification from being sent twice + if (!empty($info_sendto['email']) && $assigned_user->email != $info_sendto['email']) { + $sendto[] = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'])." <".$info_sendto['email'].">"; } }