1
0
Fork 0

Merge pull request #3065 from joker806/phar_symlinks

Skip external symlinks when creating PHAR archive
pull/3088/head
Jordi Boggiano 2014-06-29 16:00:03 +02:00
commit 02984abf23
1 changed files with 4 additions and 0 deletions

View File

@ -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, '#').'#',
'',