From 255033a27f13b7d6ffbd0e1079301949d792f185 Mon Sep 17 00:00:00 2001 From: alec Date: Thu, 12 Jan 2012 14:53:11 +0000 Subject: - Fix possible infinite loop in buildThreadData() git-svn-id: https://svn.roundcube.net/trunk@5760 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/rcube_result_thread.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'roundcubemail/program/include/rcube_result_thread.php') diff --git a/roundcubemail/program/include/rcube_result_thread.php b/roundcubemail/program/include/rcube_result_thread.php index 63d54a109..0cfd383eb 100644 --- a/roundcubemail/program/include/rcube_result_thread.php +++ b/roundcubemail/program/include/rcube_result_thread.php @@ -553,10 +553,12 @@ class rcube_result_thread private function buildThreadData($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->buildThreadData($val, $depth, $children, $level + 1); + } } } -- cgit v1.2.3