!377 修复当 $myid 为字符串类型时出现的无限递归的问题

Merge pull request !377 from T2cc/N/A
pull/380/head
Karson 2022-01-20 02:47:14 +00:00 committed by Gitee
commit 6569dfbb3c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 2 deletions

View File

@ -112,10 +112,10 @@ class Tree
if (!isset($value['id'])) {
continue;
}
if ($value[$this->pidname] == $myid) {
if ((string)$value[$this->pidname] == (string)$myid) {
$newarr[] = $value;
$newarr = array_merge($newarr, $this->getChildren($value['id']));
} elseif ($withself && $value['id'] == $myid) {
} elseif ($withself && (string)$value['id'] == (string)$myid) {
$newarr[] = $value;
}
}