Fix target-dir with multiple slashes too
parent
a9195eb05f
commit
8d7e5cdda5
|
@ -118,7 +118,7 @@ class Package extends BasePackage
|
|||
return;
|
||||
}
|
||||
|
||||
return ltrim(preg_replace('{ (?:^|[\\\\/]) \.\.? (?:[\\\\/]|$) (?:\.\.? (?:[\\\\/]|$) )*}x', '/', $this->targetDir), '/');
|
||||
return ltrim(preg_replace('{ (?:^|[\\\\/]+) \.\.? (?:[\\\\/]+|$) (?:\.\.? (?:[\\\\/]+|$) )*}x', '/', $this->targetDir), '/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -94,5 +94,8 @@ class CompletePackageTest extends TestCase
|
|||
|
||||
$package->setTargetDir('/foo/..');
|
||||
$this->assertEquals('foo/', $package->getTargetDir());
|
||||
|
||||
$package->setTargetDir('/foo/..//bar');
|
||||
$this->assertEquals('foo/bar', $package->getTargetDir());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue