Answer hidden entries and comments the same as missing ones (#3674)
- Answer hidden entries with the same 404 as missing ones
Entry URLs let anyone probe for hidden entries. A private entry's slug URL
got a 403 "protected" page while a missing slug got 404, and in an
adult-flagged journal the interstitial answered for wrong-anum and missing
slug URLs but not for hidden entries.
DW::Controller::Journal now decides before the adult interstitial and
make_journal: a missing entry, wrong anum, or entry the viewer can't see
gets one 404 page (error/unavailable.tt, shared with the JS journal
server) that depends only on the viewer. Public suspended entries keep
their suspension notice, since their existence is already public.
correct_anum loads the row before reading anum, so slug lookups no longer
report a wrong anum.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
- Answer hidden comments the same as missing ones
A comment id in a request could tell a comment the viewer can't see
(screened, deleted, by a suspended user, on another entry, or with the
wrong anum) from one that doesn't exist. ?thread= rendered a hidden
comment's placeholder instead of falling back to the whole entry, and
?view= could pick its page. ?replyto= answered 403 for screened comments
and suspended posters but 404 for missing ones, ?edit= and talkpost_do
edits said "not yours" instead of "invalid", and replies through
talkpost_do were accepted for hidden parents. /go threadroot redirected
for hidden comments, /talkscreen and /delcomment named deleted comments
before checking permission, and /manage/tracking named deleted comments
and hidden entries.
LJ::Entry->visible_comment is now the one test for all of these. The
journal controller answers hidden replyto and edit ids with the same 404
as hidden entries, before the adult interstitial. load_comments ignores
hidden thread and view ids as it does missing ones. Journal managers keep
the detailed talkscreen and delcomment errors, since they can act on
every comment in the journal.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com