Skip to content

Commit

Permalink
Evarisk#3425 [DU] fix: check ref and sanitized ref to send DU by mail
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-micka committed Oct 17, 2023
1 parent 43e0de7 commit ef4ee2d
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,12 @@

if (!in_array($object->element, array('societe', 'user', 'member'))) {
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$fileparams = dol_dir_list($diroutput, 'files', 0, '', [], 'date', 'SORT_DESC');
$lastRef = pathinfo($fileparams[0]['name']);
$fileparams = dol_dir_list($diroutput, 'files', 0, '', [], 'date', 'SORT_DESC');
$lastRef = pathinfo($fileparams[0]['name']);
$lastRefSanitized = dol_sanitizeFileName($lastRef['filename']);
$lastRefSanitized = str_replace(' ', '_', $lastRefSanitized);
foreach ($fileparams as $fileparam) {
preg_match('/' . $lastRef['filename'] . '/', $fileparam['name']) ? $filevalue[] = $fileparam['fullname'] : 0;
preg_match('/' . $lastRef['filename'] . '/', $fileparam['name']) || preg_match('/' . $lastRefSanitized . '/', $fileparam['name']) ? $filevalue[] = $fileparam['fullname'] : 0;
}
}

Expand Down

0 comments on commit ef4ee2d

Please sign in to comment.