Changeset 12567

Show
Ignore:
Timestamp:
02/20/08 14:15:26 (11 months ago)
Author:
pottedmeat
Message:

Refs #5602. Stop recursion from some of the messed up OO we have

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • util/branches/dev/jsdoc/jsdoc.module

    r12566 r12567  
    30003000} 
    30013001 
    3002 function _jsdoc_get_tree($environments, $parent = 0, $depth = -1) { 
     3002function _jsdoc_get_tree($environments, $parent = 0, $depth = -1, $visited=array()) { 
    30033003  static $children, $parents, $terms; 
    30043004 
     
    30333033 
    30343034      if ($parents[$parent[1]]) { 
    3035         $tree = array_merge($tree, _jsdoc_get_tree($environments, $parent[1], $depth)); 
     3035        if (in_array($parent[1], $visited)) { 
     3036          return $tree; 
     3037        } 
     3038        $visited[] = $parent[1]; 
     3039        $tree = array_merge($tree, _jsdoc_get_tree($environments, $parent[1], $depth, $visited)); 
    30363040      } 
    30373041    }