Skip to content

Fix thread visibility not being checked #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: major
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Upload/inc/plugins/asb/modules/recent_posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down