1
0
Fork 0

Detect broken symlinks when checking for a package's presence, fixes #6708

pull/10823/head
Jordi Boggiano 2022-06-06 15:22:41 +02:00
parent a76a1c9fc2
commit e3527ea37f
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 13 additions and 1 deletions

View File

@ -90,7 +90,19 @@ class LibraryInstaller implements InstallerInterface, BinaryPresenceInterface
return true;
}
return (Platform::isWindows() && $this->filesystem->isJunction($installPath)) || is_link($installPath);
if (Platform::isWindows() && $this->filesystem->isJunction($installPath)) {
return true;
}
if (is_link($installPath)) {
if (realpath($installPath) === false) {
return false;
}
return true;
}
return false;
}
/**