Skip to content

Commit 0a11a51

Browse files
committed
Support absolute symlinks
1 parent f9c76ec commit 0a11a51

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/php/xp/lambda/PackageLambda.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ private function add(ZipArchiveWriter $zip, Path $path, Path $base, $prefix= '')
3838
// - Files: Add to ZIP
3939
// - Folders: Recursively add all subfolders and files therein
4040
if (Sources::IS_LINK === ($stat['mode'] & Sources::IS_LINK)) {
41-
$resolved= $path->parent()->resolve(readlink($path))->asRealpath($base);
41+
$target= new Path(readlink($path));
42+
$resolved= Path::real($target->isAbsolute() ? $target : [$path->parent(), $target], $base);
4243
if ($resolved->exists()) {
4344
$base= $resolved->isFile() ? new Path(dirname($resolved)) : $resolved;
4445
yield from $this->add($zip, $resolved, $base, $relative.DIRECTORY_SEPARATOR);

0 commit comments

Comments
 (0)