Name the address the code was sent to (3.3) - #218
Open
nursoda wants to merge 3 commits into
Open
Conversation
The login screen said that a code had been sent, but not where to. A user who receives nothing then cannot tell whether the account carries the right address at all. It now shows the same masked form the personal settings use. The address goes inside the two existing sentences rather than on a line of its own. A line of its own would state the same fact twice, and as a bare fragment it gives a translator no subject and no verb to make the address agree with; several languages need it inside the sentence to inflect it at all. Each sentence therefore has a second variant that names the address, so what a translator sees is always a whole sentence. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Olav Seyfarth <olav@seyfarth.de>
The masker returned anything it could not parse unchanged, which was harmless while only the settings used it and is not now that the login screen shows the result. A quoted local part may hold a space or a second '@' and is delivered normally, and an address written through occ passes no validation at all, so either could have been readable in full on the screen that promises a mask. Such a value is now hidden whole, as IEMailAddressMasker::HIDDEN. That mask names no address, so putting it on the screen would leave the user with "sent to *@*" — nothing, in exactly the case where naming the address was meant to reassure them. Both screens that show the address therefore ask for the mask through one method, which turns HIDDEN into the empty string: the login challenge and the enrolment step during login. The empty string is what already told them there is nothing to name, so a single guard on each screen covers both "no address at all" and "an address we cannot name", and the two cannot drift apart. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Olav Seyfarth <olav@seyfarth.de>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Olav Seyfarth <olav@seyfarth.de>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Aug 27, 2026
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.
The 3.3 twin of #215. Same change, same reasoning; this text repeats
what matters so the pull request stands on its own.
The login challenge said that a code had been sent, but not where to. A user who
receives nothing could not tell whether the account carries the right address at
all. It now names the address in the same masked form the personal settings use:
a*@*.org. The address sits inside the two existing sentences rather than on aline of its own — a separate line would state the same fact twice, and as a bare
fragment it gives a translator no subject and no verb to make the address agree
with.
Showing the address made a second thing urgent.
EMailAddressMaskerused toreturn anything it could not parse unchanged — harmless while only the
settings read it, a disclosure once a login screen prints it. An address whose local part is quoted —
"jo hn"@example.org, which the standard allows — may hold a space or a second@and is delivered normally, and an address writtenthrough
occpasses no validation at all. Such a value is now hidden whole, andbecause that placeholder names no address, both screens that show one turn it into
the empty string and use the wording that names none.
Why the whole change, not only the hardening
This line normally takes security fixes only, and of the two commits just the
EMailAddressMaskerhardening is one. Carrying the naming as well is a deliberatedecision: the two belong together — the hardening exists because the screen
names the address — and splitting them would leave 3.3 with a fail-closed masker
whose only caller does nothing with it, plus a diff that no longer matches the
main line. Keeping the lines identical here is worth more than the smaller change.
Translations lag behind, on purpose
Three strings are new: the two sentences that name the address, and the
enrolment screen's variant without one (
Codes will be sent to your primary email address., with a full stop where the existing one has a colon). Until Transifex hasthem, a non-English instance renders them in English while every other string
stays translated — the fallback sentences are unchanged and keep their existing
translations. The l10n bot only sees strings that reached the repository, so merge
a few days before a release rather than on the day of it.
Checked
php-legacy, because Psalm 6.8.2 refuses torun on PHP 8.5
Nextcloud 33 and 34 and a browser pass through all four screen states
🤖 Generated with Claude Code, verified, tweaked and approved by @nursoda.