FIX Do not delete files into sym links
Conflicts: htdocs/core/lib/files.lib.php
This commit is contained in:
parent
aeba02fb22
commit
ac3a270e17
@ -588,7 +588,7 @@ function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a dir to another dir.
|
||||
* Copy a dir to another dir. This include recursive subdirectories.
|
||||
*
|
||||
* @param string $srcfile Source file (a directory)
|
||||
* @param string $destfile Destination file (a directory)
|
||||
@ -632,7 +632,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep
|
||||
{
|
||||
if ($file!="." && $file!="..")
|
||||
{
|
||||
if (is_dir($ossrcfile."/".$file))
|
||||
if (is_dir($ossrcfile."/".$file) && ! is_link($ossrcfile."/".$file))
|
||||
{
|
||||
//var_dump("xxx dolCopyDir $srcfile/$file, $destfile/$file, $newmask, $overwriteifexists");
|
||||
$tmpresult=dolCopyDir($srcfile."/".$file, $destfile."/".$file, $newmask, $overwriteifexists, $arrayreplacement);
|
||||
@ -999,7 +999,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a file or several files with a mask
|
||||
* Remove a file or several files with a mask.
|
||||
* This delete file physically but also database indexes.
|
||||
*
|
||||
* @param string $file File to delete or mask of files to delete
|
||||
* @param int $disableglob Disable usage of glob like * so function is an exact delete function that will return error if no file found
|
||||
@ -1154,7 +1155,7 @@ function dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$
|
||||
|
||||
if ($item != "." && $item != "..")
|
||||
{
|
||||
if (is_dir(dol_osencode("$dir/$item")))
|
||||
if (is_dir(dol_osencode("$dir/$item")) && ! is_link(dol_osencode("$dir/$item")))
|
||||
{
|
||||
$count=dol_delete_dir_recursive("$dir/$item", $count, $nophperrors, 0, $countdeleted);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user