Finishing previous commit, verify target exists before creating (thread) links.

This commit is contained in:
Retro_Guy 2024-02-02 13:10:01 -07:00
parent 8ad1b0b71a
commit 38c2aa2d7e
1 changed files with 6 additions and 1 deletions

View File

@ -342,10 +342,15 @@ function display_threads($threads, $oldest)
$url = $thissite . "/article-flat.php?id=" . $target['number'] . "&group=" . _rawurlencode($target['newsgroup']) . "#" . $target['number'];
echo '<p class=np_ob_subject>';
echo '<b><a href="' . $url . '"><span>' . headerDecode($target['subject']) . '</span></a></b>';
// link for (thread), if possible
if (isset($this_overboard['threadlink'][$value])) {
$thread = get_data_from_msgid($this_overboard['threadlink'][$value], $target['newsgroup']);
echo '<font class="np_ob_group"><a href="article-flat.php?id=' . $thread['number'] . '&group=' . rawurlencode($thread['newsgroup']) . '#' . $thread['number'] . '"> (thread)</a></font>';
if ($thread !== false) {
echo '<font class="np_ob_group"><a href="article-flat.php?id=' . $thread['number'] . '&group=' . rawurlencode($thread['newsgroup']) . '#' . $thread['number'] . '"> (thread)</a></font>';
}
}
echo '</p>';
echo '</p><p class=np_ob_group>';
echo '<a href="' . $groupurl . '"><span class="visited">' . $target['newsgroup'] . '</span></a>';