Fix: split into 2 functions
This commit is contained in:
parent
3e033ef48c
commit
b39c9c514a
@ -770,11 +770,7 @@ function dolMoveUploadedFile($src_file, $dest_file, $allowoverwrite, $notrigger=
|
|||||||
*/
|
*/
|
||||||
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$object=null)
|
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$object=null)
|
||||||
{
|
{
|
||||||
global $db, $conf, $user, $langs;
|
global $db, $hookmanager;
|
||||||
global $hookmanager;
|
|
||||||
|
|
||||||
$langs->load("other");
|
|
||||||
$langs->load("errors");
|
|
||||||
|
|
||||||
if (! is_object($hookmanager))
|
if (! is_object($hookmanager))
|
||||||
{
|
{
|
||||||
@ -800,6 +796,28 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$objec
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
return dolDeleteFile($file, $disableglob, $nophperrors, $notrigger, $object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a file or several files with a mask
|
||||||
|
*
|
||||||
|
* @param string $file File to delete or mask of file to delete
|
||||||
|
* @param int $disableglob Disable usage of glob like *
|
||||||
|
* @param int $nophperrors Disable all PHP output errors
|
||||||
|
* @param int $notrigger Disable all triggers
|
||||||
|
* @param object $object Current object in use
|
||||||
|
* @return boolean True if file is deleted, False if error
|
||||||
|
* @see dol_delete_file
|
||||||
|
*/
|
||||||
|
function dolDeleteFile($file,$disableglob=0,$nophperrors=0,$notrigger=0,$object=null)
|
||||||
|
{
|
||||||
|
global $db, $conf, $user, $langs;
|
||||||
|
|
||||||
|
$langs->load("other");
|
||||||
|
$langs->load("errors");
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
//print "x".$file." ".$disableglob;
|
//print "x".$file." ".$disableglob;
|
||||||
@ -849,7 +867,6 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$objec
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $ok;
|
return $ok;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user