2
0
forked from Wavyzz/dolibarr

Clean code

This commit is contained in:
Laurent Destailleur
2020-09-10 17:49:05 +02:00
parent bd54033975
commit 8d93b76258
2 changed files with 6 additions and 9 deletions

View File

@@ -1155,6 +1155,7 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
return false;
}
$reshook = 0;
if (empty($nohook))
{
$hookmanager->initHooks(array('fileslib'));
@@ -1174,17 +1175,13 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
if ($reshook < 0) return false;
return true;
} else {
//print "x".$file." ".$disableglob;exit;
dol_syslog("reshook=".$reshook);
$file_osencoded = dol_osencode($file); // New filename encoded in OS filesystem encoding charset
if (empty($disableglob) && !empty($file_osencoded))
{
$ok = true;
$globencoded = str_replace('[', '\[', $file_osencoded);
$globencoded = str_replace(']', '\]', $globencoded);
dol_syslog("globencoded=".$globencoded);
$listofdir = glob($globencoded);
dol_syslog("listofdir=".join(', ', $listofdir));
if (!empty($listofdir) && is_array($listofdir))
{
foreach ($listofdir as $filename)