From a5472b58d1584caeae067e2bee7dc9bd6367606b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 5 Jun 2016 00:24:00 +0200 Subject: [PATCH] FIX #5108 --- htdocs/core/ajax/ajaxdirpreview.php | 5 ++++- htdocs/ecm/index.php | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 997e27adb20..f1352f8e933 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -240,7 +240,10 @@ if ($section) require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $useglobalvars=1; $form = new Form($db); - $formquestion=array('urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile')); + $formquestion=array( + 'urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile'), + 'section'=>array('type'=>'hidden','value'=>$section,'name'=>'section') + ); print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0)); } diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index e3fa4ece95d..797e759fb13 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -175,10 +175,9 @@ if ($action == 'confirm_deletefile') dol_print_error($db,$ecmdir->error); exit; } - $relativepath=$ecmdir->getRelativePath(); } else $relativepath=''; - $upload_dir = $conf->ecm->dir_output.($relativepath?'/'.$relativepath:''); + $upload_dir = $conf->ecm->dir_output; $file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP). $ret=dol_delete_file($file);