[3.0] Answer an activation link that names nobody - #9482
Merged
live627 merged 1 commit intoAug 11, 2026
Conversation
loadMember() assigns $this->member only when it finds someone, and the line after it reads $this->member->is_activated regardless, so an activation link for a member id that no longer exists is a 500 rather than a page. execute() already handles this: if the member is not set it shows the form that asks for a username and an activation code, which is what 2.1 did. It never gets the chance, because the constructor has already thrown. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.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.
Description
An activation link whose
unames nobody is a 500.Activate::loadMember()assigns$this->memberonly when it finds someone. Theline after the call reads
$this->member->is_activatedunconditionally.The handling for this already exists and cannot be reached.
Activate::execute()opens withwhich is 2.1's behaviour — the form asking for a username and an activation code.
The constructor throws first, so
execute()never runs.This is reachable in ordinary use: a member deleted while their activation mail
is in flight, an id that got mangled in a mail client, or a link followed after
the account was pruned.
What changes
The constructor returns when
loadMember()found nothing, and leaves the answerto the guard
execute()already has.Testing
?action=activate;u=999;code=xand?action=activate;u=999both give a 200 with"User does not exist" and the retry form, and log nothing. A real activation link
still activates;
?action=activatewith noustill shows the resend form.Issues References (Fixes|Related|Closes)
Related to #7933