fix infinite recursion bug

This commit is contained in:
John Bintz 2009-11-10 21:34:16 -05:00
parent 763b2c42b2
commit 0f9bacb81a
1 changed files with 7 additions and 4 deletions

View File

@ -156,10 +156,13 @@ class ComicPressStoryline {
if (isset($this->_structure[$id])) {
$all_adjacent = array();
do {
if ($has_adjacent = isset($this->_structure[$id][$direction])) {
$all_adjacent[] = $this->_structure[$id][$direction];
$id = $this->_structure[$id][$direction];
}
$has_adjacent = false;
if (!in_array($id, $all_adjacent)) {
if ($has_adjacent = isset($this->_structure[$id][$direction])) {
$all_adjacent[] = $this->_structure[$id][$direction];
$id = $this->_structure[$id][$direction];
}
}
} while ($has_adjacent);
return $all_adjacent;
}