diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-12 14:53:11 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-12 14:53:11 +0000 |
| commit | 255033a27f13b7d6ffbd0e1079301949d792f185 (patch) | |
| tree | 8d8a3551b0f0439d64ef22e729401ce573c2b31a /roundcubemail/program/include | |
| parent | 903722017545bd139e3c04c183ec10a9458a5196 (diff) | |
- Fix possible infinite loop in buildThreadData()
git-svn-id: https://svn.roundcube.net/trunk@5760 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/rcube_result_thread.php | 8 |
1 files changed, 5 insertions, 3 deletions
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); + } } } |
