mirror of
https://github.com/friendica/friendica
synced 2024-12-23 22:40:17 +00:00
Merge pull request #2088 from annando/1511-endless-loop
Prevention of endless loops in the conversation
This commit is contained in:
commit
c409c66a7a
1 changed files with 15 additions and 6 deletions
|
@ -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