Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Daoud-mohamed committed Nov 14, 2024
2 parents f96a7cb + cbc7b35 commit 0a0ece6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions htdocs/compta/paiement/rapport.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@
}

// Delete file from disk
if ($action == 'removedoc' && !empty($permissiontoread) && $fileToRemove) {
$fileDirectory = dirname($dir.'/'.$fileToRemove);
if (dol_delete_file($dir.'/'.$fileToRemove)) {
if ($action == 'removedoc' && $permissiontoread && $fileToRemove) {
$fullpathfile = dol_sanitizePathName($dir.'/'.$fileToRemove);
$fileDirectory = dirname($fullpathfile);
if (dol_delete_file($fullpathfile)) {
// Delete empty directory after file deletion
if (empty(dol_dir_list($fileDirectory))) {
dol_delete_dir($fileDirectory);
Expand Down Expand Up @@ -154,7 +155,7 @@
print '<td>'.$langs->trans("Reporting").'</td>';
print '<td class="right">'.$langs->trans("Size").'</td>';
print '<td class="right">'.$langs->trans("Date").'</td>';
print '<td class="right">'.$langs->trans("Delete").'</td>';
print '<td class="right"></td>';
print '</tr>';

$files = (dol_dir_list($dir.'/'.$year, 'files', 0, '^payments-[0-9]{4}-[0-9]{2}\.pdf$', '', 'name', SORT_DESC, 1));
Expand Down

0 comments on commit 0a0ece6

Please sign in to comment.