diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index cf00f60d31d..7c620aa404c 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -99,11 +99,13 @@ if ($permtoadd && $module == 'ecm') { // If on file manager medias in ecm print ""; @@ -154,19 +156,23 @@ if ($action == 'delete_section') { // End confirm if ($action == 'confirmconvertimgwebp') { + $section_dir=GETPOST('section_dir', 'alpha'); + $section=GETPOST('section', 'alpha'); + $form = new Form($db); + $formquestion['section_dir']=array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir'); + $formquestion['section']=array('type'=>'hidden', 'value'=>$section, 'name'=>'section'); if ($module == 'medias') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$website->ref.'&dir='.$_GET['dir'], $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', '', "yes", 1); - } else { - print $form->formconfirm($_SERVER["PHP_SELF"].'?dir='.$_GET['dir'], $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', '', "yes", 1); + $formquestion['website']=array('type'=>'hidden', 'value'=>$website->ref, 'name'=>'website'); } + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', $formquestion, "yes", 1); $action = 'file_manager'; } if ($action == 'convertimgwebp' && $permtoadd) { if ($module == 'medias') { - $imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/'.$_GET['dir']; + $imagefolder = $conf->website->dir_output.'/'.$websitekey.'/medias/'.GETPOST('section_dir', 'alpha'); } else { - $imagefolder = $conf->ecm->dir_output.'/'.$_GET['dir']; + $imagefolder = $conf->ecm->dir_output.'/'.GETPOST('section_dir', 'alpha'); } include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';