From e6b45e853aad1036118273c69c69e88138480f42 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 7 Sep 2020 13:54:14 +0200 Subject: [PATCH] Fix status command handling of symlinks, and especially broken ones, fixes #9169 --- src/Composer/Package/Comparer/Comparer.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Composer/Package/Comparer/Comparer.php b/src/Composer/Package/Comparer/Comparer.php index c0ab98d9c..ed08cad42 100644 --- a/src/Composer/Package/Comparer/Comparer.php +++ b/src/Composer/Package/Comparer/Comparer.php @@ -102,18 +102,18 @@ class Comparer if ($dh = opendir($dir)) { while ($file = readdir($dh)) { if ($file !== '.' && $file !== '..') { - if (is_dir($dir.'/'.$file)) { + if (is_link($dir.'/'.$file)) { + $array[$dir][$file] = readlink($dir.'/'.$file); + } elseif (is_dir($dir.'/'.$file)) { if (!count($array)) { $array[0] = 'Temp'; } if (!$this->doTree($dir.'/'.$file, $array)) { return false; } - } else { - if (filesize($dir.'/'.$file)) { - set_time_limit(30); - $array[$dir][$file] = md5_file($dir.'/'.$file); - } + } elseif (is_file($dir.'/'.$file) && filesize($dir.'/'.$file)) { + set_time_limit(30); + $array[$dir][$file] = md5_file($dir.'/'.$file); } } }