diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index a45b2eded012a..2691f99d7bd3c 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -96,11 +96,11 @@ // Delete file from disk if ($action == 'removedoc' && $permissiontoread && $fileToRemove) { - $directory = dirname($dir.'/'.$fileToRemove); + $fileDirectory = dirname($dir.'/'.$fileToRemove); if (dol_delete_file($dir.'/'.$fileToRemove)) { // Delete empty directory after file deletion - if (empty(dol_dir_list($directory))) { - dol_delete_dir($directory); + if (empty(dol_dir_list($fileDirectory))) { + dol_delete_dir($fileDirectory); } setEventMessages($langs->trans("FileWasRemoved", $fileToRemove), null, 'mesgs'); } else { diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index 58471ab6b40db..7b442a9d28e35 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -98,11 +98,11 @@ // Delete file from disk if ($action == 'removedoc' && $permissiontoread && $fileToRemove) { - $directory = dirname($dir.'/'.$fileToRemove); + $fileDirectory = dirname($dir.'/'.$fileToRemove); if (dol_delete_file($dir.'/'.$fileToRemove)) { // Delete empty directory after file deletion - if (empty(dol_dir_list($directory))) { - dol_delete_dir($directory); + if (empty(dol_dir_list($fileDirectory))) { + dol_delete_dir($fileDirectory); } setEventMessages($langs->trans("FileWasRemoved", $fileToRemove), null, 'mesgs'); } else {