1
0
Fork 0

Prevention of endless loops in the conversation

This commit is contained in:
Michael Vogel 2015-11-18 23:57:53 +01:00
parent a4f66ea4ca
commit 37f466d16e

View file

@ -1291,6 +1291,15 @@ function conv_sort($arr,$order) {
$parents = array(); $parents = array();
$children = 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) foreach($arr as $x)
if($x['id'] == $x['parent']) if($x['id'] == $x['parent'])