FIX delete ECM directory

This commit is contained in:
Laurent Destailleur 2022-10-14 15:57:58 +02:00
parent 5190bc0d04
commit 746a00047b
2 changed files with 4 additions and 3 deletions

View File

@ -1372,7 +1372,7 @@ function dol_delete_dir($dir, $nophperrors = 0)
// Security:
// We refuse transversal using .. and pipes into filenames.
if (preg_match('/\.\./', $dir) || preg_match('/[<>|]/', $dir)) {
dol_syslog("Refused to delete dir ".$dir, LOG_WARNING);
dol_syslog("Refused to delete dir ".$dir.' (contains invalid char sequence)', LOG_WARNING);
return false;
}

View File

@ -469,13 +469,14 @@ if ($action != 'edit' && $action != 'delete' && $action != 'deletefile') {
print '</div>';
}
// Confirm remove file
if ($action == 'deletefile') {
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST("section", 'alpha')).'&urlfile='.urlencode(GETPOST("urlfile")).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
}
// Confirm remove file
if ($action == 'delete_dir') {
// Confirm remove dir
if ($action == 'delete' || $action == 'delete_dir') {
$relativepathwithoutslash = preg_replace('/[\/]$/', '', $relativepath);
//Form to close proposal (signed or not)