Merge remote-tracking branch 'origin/3.5' into develop
This commit is contained in:
commit
123cd787f5
@ -726,6 +726,8 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
|
|||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
|
||||||
|
dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook);
|
||||||
|
|
||||||
if (empty($nohook))
|
if (empty($nohook))
|
||||||
{
|
{
|
||||||
$hookmanager->initHooks(array('fileslib'));
|
$hookmanager->initHooks(array('fileslib'));
|
||||||
|
|||||||
@ -41,12 +41,17 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|||||||
{
|
{
|
||||||
if ($object->id)
|
if ($object->id)
|
||||||
{
|
{
|
||||||
$urlfile = GETPOST('urlfile', 'alpha');
|
$urlfile = GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||||
$linkid = GETPOST('linkid', 'int');
|
if (GETPOST('section')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir
|
||||||
|
else // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
|
||||||
|
{
|
||||||
|
$urlfile=basename($urlfile);
|
||||||
|
$file = $upload_dir . "/" . $urlfile;
|
||||||
|
}
|
||||||
|
$linkid = GETPOST('linkid', 'int'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||||
|
|
||||||
if ($urlfile)
|
if ($urlfile)
|
||||||
{
|
{
|
||||||
$file = $upload_dir . "/" . $urlfile; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
|
|
||||||
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
setEventMessage($langs->trans("FileWasRemoved", $urlfile));
|
setEventMessage($langs->trans("FileWasRemoved", $urlfile));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user