|
@@ -160,9 +160,11 @@ class LibraryInstaller implements InstallerInterface
|
|
$initialDownloadPath = $this->getInstallPath($initial);
|
|
$initialDownloadPath = $this->getInstallPath($initial);
|
|
$targetDownloadPath = $this->getInstallPath($target);
|
|
$targetDownloadPath = $this->getInstallPath($target);
|
|
if ($targetDownloadPath !== $initialDownloadPath) {
|
|
if ($targetDownloadPath !== $initialDownloadPath) {
|
|
- // if the target is part of the initial dir, we force a remove + install
|
|
|
|
|
|
+ // if the target and initial dirs intersect, we force a remove + install
|
|
// to avoid the rename wiping the target dir as part of the initial dir cleanup
|
|
// to avoid the rename wiping the target dir as part of the initial dir cleanup
|
|
- if (strpos($initialDownloadPath, $targetDownloadPath) === 0) {
|
|
|
|
|
|
+ if (substr($initialDownloadPath, 0, strlen($targetDownloadPath)) === $targetDownloadPath
|
|
|
|
+ || substr($targetDownloadPath, 0, strlen($initialDownloadPath)) === $initialDownloadPath
|
|
|
|
+ ) {
|
|
$this->removeCode($initial);
|
|
$this->removeCode($initial);
|
|
$this->installCode($target);
|
|
$this->installCode($target);
|
|
|
|
|