1
0
Fork 0

Skip external symlinks when creating PHAR archive

pull/3065/head
Josef Martinec 2014-06-19 17:06:31 +02:00
parent ac497feaba
commit 24f0f32543
1 changed files with 4 additions and 0 deletions

View File

@ -52,6 +52,10 @@ class ArchivableFilesFinder extends \FilterIterator
$this->finder = new Finder\Finder(); $this->finder = new Finder\Finder();
$filter = function (\SplFileInfo $file) use ($sources, $filters, $fs) { $filter = function (\SplFileInfo $file) use ($sources, $filters, $fs) {
if ($file->isLink() && strpos($file->getLinkTarget(), $sources) !== 0) {
return false;
}
$relativePath = preg_replace( $relativePath = preg_replace(
'#^'.preg_quote($sources, '#').'#', '#^'.preg_quote($sources, '#').'#',
'', '',