Merge pull request #2088 from annando/1511-endless-loop
Prevention of endless loops in the conversation
This commit is contained in:
commit
c409c66a7a
|
@ -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'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user