Repository navigation
Keep locked passworded forums out of Recent Topics - #204
Merged
Merged
Conversation
get_forum_list() built the forum list from f_read / f_list_topics only. phpBB grants f_read on a passworded forum regardless of the password, so a forum the user had not unlocked was included, and its topic titles, last-post subjects and authors showed in the Recent Topics block on the index, on viewforum and on /app.php/rt. Drop the forums returned by user::get_passworded_forums(), the same check the index, viewforum, search and feeds use. It runs before the forum_recent_topics query, so the single-forum path is covered too. Closes #193 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #193.
Problem
get_forum_list()built the forum list fromf_read/f_list_topicsonly. phpBB grantsf_readon a passworded forum regardless of the password, so a forum the user hadn't unlocked was still included. Its topic titles, last-post subjects and authors showed in the Recent Topics block on the index, on viewforum and on/app.php/rt, even though the board itself hides them until the password is entered.Fix
core/recenttopics.php: after the permission pass, drop the forums returned by$this->user->get_passworded_forums(). That's the same check the index, viewforum, search and feeds use. It runs before theforum_recent_topicsquery, so the single-forum path (which skips that query) is covered too.Tests
tests/core/forum_list_test.php, documented intests/tests.md:Checked on the local board as a guest (temporary password on a forum, removed afterwards):
pbTech Styletopic, indexpbTech Styletopic,/app.php/rtNo changelog entry or version bump: per this repo's convention, those go in the release commit.
🤖 Generated with Claude Code