Prevention of endless loops in the conversation
This commit is contained in:
parent
a4f66ea4ca
commit
37f466d16e
|
@ -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'])
|
||||
|
|
Loading…
Reference in a new issue