Skip to content

Commit

Permalink
Fix: Remove warning
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 4, 2013
1 parent af22d38 commit e40d644
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions htdocs/core/lib/files.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -742,13 +742,18 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
{
$globencoded=str_replace('[','\[',$file_osencoded);
$globencoded=str_replace(']','\]',$globencoded);
foreach (glob($globencoded) as $filename)
$listofdir=glob($globencoded);
if (! empty($listofdir) && is_array($listofdir))
{
if ($nophperrors) $ok=@unlink($filename); // The unlink encapsulated by dolibarr
else $ok=unlink($filename); // The unlink encapsulated by dolibarr
if ($ok) dol_syslog("Removed file ".$filename, LOG_DEBUG);
else dol_syslog("Failed to remove file ".$filename, LOG_WARNING);
foreach ($listofdir as $filename)
{
if ($nophperrors) $ok=@unlink($filename); // The unlink encapsulated by dolibarr
else $ok=unlink($filename); // The unlink encapsulated by dolibarr
if ($ok) dol_syslog("Removed file ".$filename, LOG_DEBUG);
else dol_syslog("Failed to remove file ".$filename, LOG_WARNING);
}
}
else dol_syslog("No files to delete found", LOG_WARNING);
}
else
{
Expand Down

0 comments on commit e40d644

Please sign in to comment.