update lock clucknut
All checks were successful
All checks were successful
This commit is contained in:
7
vendor/symfony/filesystem/Filesystem.php
vendored
7
vendor/symfony/filesystem/Filesystem.php
vendored
@@ -443,6 +443,8 @@ public function makePathRelative(string $endPath, string $startPath): string
|
||||
throw new InvalidArgumentException(\sprintf('The end path "%s" is not absolute.', $endPath));
|
||||
}
|
||||
|
||||
$originalEndPath = $endPath;
|
||||
|
||||
// Normalize separators on Windows
|
||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
||||
$endPath = str_replace('\\', '/', $endPath);
|
||||
@@ -499,6 +501,11 @@ public function makePathRelative(string $endPath, string $startPath): string
|
||||
// Construct $endPath from traversing to the common path, then to the remaining $endPath
|
||||
$relativePath = $traverser.('' !== $endPathRemainder ? $endPathRemainder.'/' : '');
|
||||
|
||||
// Remove ending "/" if $endPath points to an existing file
|
||||
if (str_ends_with($relativePath, '/') && is_file($originalEndPath)) {
|
||||
$relativePath = substr($relativePath, 0, -1);
|
||||
}
|
||||
|
||||
return '' === $relativePath ? './' : $relativePath;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user