diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 84553edcc38..dff56695ace 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -150,26 +150,29 @@ if ($action == 'add' && $user->rights->ecm->setup) } // Remove file -if ($action == 'confirm_deletefile' && GETPOST('confirm') == 'yes') +if ($action == 'confirm_deletefile') { - $result=$ecmdir->fetch($section); - if (! $result > 0) - { - dol_print_error($db,$ecmdir->error); - exit; - } - $relativepath=$ecmdir->getRelativePath(); - $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; - $file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). + if (GETPOST('confirm') == 'yes') + { + $result=$ecmdir->fetch($section); + if (! $result > 0) + { + dol_print_error($db,$ecmdir->error); + exit; + } + $relativepath=$ecmdir->getRelativePath(); + $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; + $file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $result=dol_delete_file($file); + $result=dol_delete_file($file); - $mesg = '