From aca70518adfa6a57b54763b4362e597e42c15890 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Mon, 13 May 2024 15:20:15 -0700 Subject: [PATCH] Cleanup article-flat.php when article is requested by message-id. --- Rocksolid_Light/rocksolid/article-flat.php | 40 ++++++++++------------ 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/Rocksolid_Light/rocksolid/article-flat.php b/Rocksolid_Light/rocksolid/article-flat.php index e1bd7da..7ddd7b6 100644 --- a/Rocksolid_Light/rocksolid/article-flat.php +++ b/Rocksolid_Light/rocksolid/article-flat.php @@ -23,27 +23,25 @@ $id = $_REQUEST["id"]; $group = _rawurldecode($_REQUEST["group"]); if (strpos($id, '@') !== false) { - if ($CONFIG['article_database'] == '1') { - $id = '<' . trim($id, '<> ') . '>'; - $database = $spooldir . '/articles-overview.db3'; - $articles_dbh = overview_db_open($database); - $articles_query = $articles_dbh->prepare('SELECT * FROM overview WHERE msgid=:messageid'); - $articles_query->execute([ - 'messageid' => $id - ]); - $found = 0; - while ($row = $articles_query->fetch()) { - $id = $row['number']; - $group = $row['newsgroup']; - $found = 1; - break; - } - $dbh = null; - if ($found) { - $newurl = 'article-flat.php?id=' . $id . '&group=' . $row['newsgroup'] . '#' . $id; - header("Location: $newurl"); - die(); - } + $id = '<' . trim($id, '<> ') . '>'; + $database = $spooldir . '/articles-overview.db3'; + $overview_dbh = overview_db_open($database); + $overview_query = $overview_dbh->prepare('SELECT * FROM overview WHERE msgid=:messageid'); + $overview_query->execute([ + 'messageid' => $id + ]); + $found = 0; + while ($row = $overview_query->fetch()) { + $id = $row['number']; + $group = $row['newsgroup']; + $found = 1; + break; + } + $overview_dbh = null; + if ($found) { + $newurl = 'article-flat.php?id=' . $id . '&group=' . $row['newsgroup'] . '#' . $id; + header("Location: $newurl"); + die(); } }