From 342aba092a5a0b592df19791b999af28fc494ef5 Mon Sep 17 00:00:00 2001 From: Omar Gonzalez Date: Tue, 6 Apr 2021 14:41:44 -0700 Subject: [PATCH] Fix thread visibility not being checked --- Upload/inc/plugins/asb/modules/recent_posts.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Upload/inc/plugins/asb/modules/recent_posts.php b/Upload/inc/plugins/asb/modules/recent_posts.php index 9ba7e6c..3664af8 100644 --- a/Upload/inc/plugins/asb/modules/recent_posts.php +++ b/Upload/inc/plugins/asb/modules/recent_posts.php @@ -162,7 +162,12 @@ function asb_recent_posts_get_content($settings, $script, $dateline) if ($dateline && $dateline !== TIME_NOW) { - $newQuery = $db->simple_select('posts p', 'pid', "p.visible='1'{$query_where} AND p.dateline > {$dateline}", array('limit' => 1)); + $newQuery = $db->simple_select( + "posts p LEFT JOIN {$db->table_prefix}threads ON (p.tid=t.tid)", + 'pid', + "p.visible='1' AND t.visible='1'{$query_where} AND p.dateline > {$dateline}", + array('limit' => 1) + ); if ($db->num_rows($newQuery) < 1) { // no new content @@ -181,7 +186,7 @@ function asb_recent_posts_get_content($settings, $script, $dateline) LEFT JOIN {$db->table_prefix}users u ON (u.uid=p.uid) LEFT JOIN {$db->table_prefix}threads t ON (t.tid=p.tid) WHERE - p.visible='1'{$query_where} + p.visible='1' AND t.visible='1'{$query_where} ORDER BY p.dateline DESC LIMIT