diff --git a/src/Composer/Package/Archiver/ArchivableFilesFinder.php b/src/Composer/Package/Archiver/ArchivableFilesFinder.php index f6cadbe21..44c682616 100644 --- a/src/Composer/Package/Archiver/ArchivableFilesFinder.php +++ b/src/Composer/Package/Archiver/ArchivableFilesFinder.php @@ -52,6 +52,10 @@ class ArchivableFilesFinder extends \FilterIterator $this->finder = new Finder\Finder(); $filter = function (\SplFileInfo $file) use ($sources, $filters, $fs) { + if ($file->isLink() && strpos($file->getLinkTarget(), $sources) !== 0) { + return false; + } + $relativePath = preg_replace( '#^'.preg_quote($sources, '#').'#', '',