Browse Source

!377 修复当 $myid 为字符串类型时出现的无限递归的问题
Merge pull request !377 from T2cc/N/A

Karson 3 years ago
parent
commit
6569dfbb3c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      extend/fast/Tree.php

+ 2 - 2
extend/fast/Tree.php

@@ -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;
             }
         }