1
0
Fork 0

Fix status command handling of symlinks, and especially broken ones, fixes #9169

pull/9197/head
Jordi Boggiano 2020-09-07 13:54:14 +02:00
parent 960413da3a
commit e6b45e853a
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 6 deletions

View File

@ -102,21 +102,21 @@ class Comparer
if ($dh = opendir($dir)) { if ($dh = opendir($dir)) {
while ($file = readdir($dh)) { while ($file = readdir($dh)) {
if ($file !== '.' && $file !== '..') { 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)) { if (!count($array)) {
$array[0] = 'Temp'; $array[0] = 'Temp';
} }
if (!$this->doTree($dir.'/'.$file, $array)) { if (!$this->doTree($dir.'/'.$file, $array)) {
return false; return false;
} }
} else { } elseif (is_file($dir.'/'.$file) && filesize($dir.'/'.$file)) {
if (filesize($dir.'/'.$file)) {
set_time_limit(30); set_time_limit(30);
$array[$dir][$file] = md5_file($dir.'/'.$file); $array[$dir][$file] = md5_file($dir.'/'.$file);
} }
} }
} }
}
if (count($array) > 1 && isset($array['0'])) { if (count($array) > 1 && isset($array['0'])) {
unset($array['0']); unset($array['0']);
} }