Skip to content
Snippets Groups Projects
Commit c52643df authored by Jared Hancock's avatar Jared Hancock
Browse files

Detect and squelch loops in topic relationships

parent 37622501
Branches
Tags
No related merge requests found
...@@ -212,8 +212,12 @@ class Topic { ...@@ -212,8 +212,12 @@ class Topic {
if ($publicOnly && !$info['public']) if ($publicOnly && !$info['public'])
continue; continue;
$name = $info['topic']; $name = $info['topic'];
$loop = array($id=>true);
while ($info['pid'] && ($info = $topics[$info['pid']])) { while ($info['pid'] && ($info = $topics[$info['pid']])) {
$name = sprintf('%s / %s', $info['topic'], $name); $name = sprintf('%s / %s', $info['topic'], $name);
if (isset($loop[$info['pid']]))
break;
$loop[$info['pid']] = true;
} }
$names[$id] = $name; $names[$id] = $name;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment