fix recursive removal and copying of dirs

This commit is contained in:
Uwe Steinmann 2021-10-04 20:26:03 +02:00
parent 790eef7e84
commit 1a61a6ca8f

View File

@ -205,14 +205,14 @@ class SeedDMS_Core_File {
{
if ($entry == ".." || $entry == ".")
continue;
else if (is_dir($path . $entry))
else if (is_dir($path . DIRECTORY_SEPARATOR . $entry))
{
if (!self::removeDir($path . $entry . "/"))
if (!self::removeDir($path . DIRECTORY_SEPARATOR . $entry . "/"))
return false;
}
else
{
if (!@unlink($path . $entry))
if (!@unlink($path . DIRECTORY_SEPARATOR . $entry))
return false;
}
}
@ -232,10 +232,10 @@ class SeedDMS_Core_File {
if ($entry == ".." || $entry == ".")
continue;
else if (is_dir($sourcePath . $entry)) {
if (!self::copyDir($sourcePath . $entry . "/", $targetPath . $entry . "/"))
if (!self::copyDir($sourcePath . DIRECTORY_SEPARATOR . $entry, $targetPath . DIRECTORY_SEPARATOR . $entry))
return false;
} else {
if (!@copy($sourcePath . $entry, $targetPath . $entry))
if (!@copy($sourcePath . DIRECTORY_SEPARATOR . $entry, $targetPath . DIRECTORY_SEPARATOR . $entry))
return false;
}
}