Merge pull request #2088 from annando/1511-endless-loop

Prevention of endless loops in the conversation
This commit is contained in:
Tobias Diekershoff 2015-11-19 06:44:04 +01:00
commit c409c66a7a
1 changed files with 15 additions and 6 deletions

View File

@ -1291,6 +1291,15 @@ function conv_sort($arr,$order) {
$parents = array();
$children = array();
$newarr = array();
// This is a preparation for having two different items with the same uri in one thread
// This will otherwise lead to an endless loop.
foreach($arr as $x)
if (!isset($newarr[$x['uri']]))
$newarr[$x['uri']] = $x;
$arr = $newarr;
foreach($arr as $x)
if($x['id'] == $x['parent'])