From 57427e6227f3bd9093daedab2a64feeb6cced4fa Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 8 Mar 2024 10:44:47 +0100 Subject: [PATCH] Fix filesystem::copy with broken symlinks, refs #11864 --- src/Composer/Util/Filesystem.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Composer/Util/Filesystem.php b/src/Composer/Util/Filesystem.php index baa3dfa8d..ad0aae983 100644 --- a/src/Composer/Util/Filesystem.php +++ b/src/Composer/Util/Filesystem.php @@ -363,6 +363,9 @@ class Filesystem */ public function copy(string $source, string $target) { + // refs https://github.com/composer/composer/issues/11864 + $target = $this->normalizePath($target); + if (!is_dir($source)) { return copy($source, $target); }