- Fix possible infinite loop in build_thread_data()

release-0.7
alecpl 13 years ago
parent be431441cb
commit 63b9ff12d2

@ -1108,10 +1108,12 @@ class rcube_imap_cache
private function build_thread_data($data, &$depth, &$children, $level = 0)
{
foreach ((array)$data as $key => $val) {
$children[$key] = !empty($val);
$depth[$key] = $level;
if (!empty($val))
$empty = empty($val) || !is_array($val);
$children[$key] = !$empty;
$depth[$key] = $level;
if (!$empty) {
$this->build_thread_data($val, $depth, $children, $level + 1);
}
}
}

Loading…
Cancel
Save