N°9503 Fix broken symlink in setup wizard

This commit is contained in:
Timmy38
2026-04-13 14:27:36 +02:00
parent 1222507205
commit 8172910c8b
3 changed files with 14 additions and 6 deletions

View File

@@ -846,14 +846,19 @@ class SetupUtils
// Skip
continue;
}
if (is_dir($sSource.'/'.$sFile)) {
$sSourcePath = $sSource.'/'.$sFile;
$sDestPath = $sDest.'/'.$sFile;
if (is_dir($sSourcePath)) {
// Recurse
self::copydir($sSource.'/'.$sFile, $sDest.'/'.$sFile, $bUseSymbolicLinks);
self::copydir($sSourcePath, $sDestPath, $bUseSymbolicLinks);
} elseif (is_link($sSourcePath)) {
$sLinkPath = readlink($sSourcePath);
symlink($sLinkPath, $sDestPath);
} else {
if ($bUseSymbolicLinks) {
symlink($sSource.'/'.$sFile, $sDest.'/'.$sFile);
symlink($sSourcePath, $sDestPath);
} else {
copy($sSource.'/'.$sFile, $sDest.'/'.$sFile);
copy($sSourcePath, $sDestPath);
}
}
}
@@ -862,6 +867,9 @@ class SetupUtils
} elseif (is_file($sSource)) {
if ($bUseSymbolicLinks) {
return symlink($sSource, $sDest);
} elseif (is_link($sSource)) {
$sLinkPath = readlink($sSource);
return symlink($sLinkPath, $sDest);
} else {
return copy($sSource, $sDest);
}