Repository navigation
Support internationalized WebFinger handles - #3882
Merged
Merged
Conversation
This was referenced Oct 16, 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.
I checked the plugin against the internationalized WebFinger handles notes from the SWICG. Receiving already worked, but non-ASCII handles were not recognized at all, and lookups did not use the form the notes ask for.
Proposed changes:
ACTIVITYPUB_USERNAME_REGEXPmatches letters and digits of any script now, plus+and%, and TLDs likexn--fiqs8s. It is used with theumodifier, so mentions andWebfinger::is_acct()accept handles likeελπίδα@ఉదాహరణ.example.Webfinger::get_identifier_and_host()builds theacct:URI the way RFC 7565 asks for: a non-ASCII userpart is percent-encoded and the host is the IDNA A-label. ASCII stays as it is, soanne.o'neill+notesis not encoded. The A-label also meanswp_safe_remote_get()does not reject the lookup anymore.to_ascii_host()converts a host with theIdnaEncoderthat ships with core, so no intl extension is needed.fold_host()uses it, so all host comparisons treat the Unicode form and the A-label the same. A label that UTS Can't find my blog on Mastodon #46 maps to plain ASCII, like a soft hyphen or fullwidth Latin, is kept as it is, so it does not compare equal to a different host.Actors::get_id_by_resource()folds both sides, soacct:lookups work with the Unicode form, the A-label and any case.subjectuses the A-label, via the newWebfinger::get_acct().Other information:
Things that change for existing sites:
acct:lookups are case-insensitive for the host now.subjectchanges fromacct:…@café.exampletoacct:…@xn--caf-dma.example. A server that compares cached subjects as plain strings would see a different value. I think that is fine, but I am not 100% sure.Not covered: non-ASCII usernames (WordPress logins are ASCII only), actor IDs on a site with a Unicode site URL, and
'in a mentioned userpart, becausewptexturizeturns it into’. Without the intl extension, hosts with decomposed accents, fullwidth letters or dots like。get a different A-label than with it.Tests use data providers with the examples from the notes.
Testing instructions:
@ελπίδα@ఉదాహరణ.example: the mention is linked and the account is addressed.acct:user@xn--…andacct:user@…in Unicode form: both resolve, and thesubjectuses the A-label.Changelog entry
Changelog Entry Details
Significance
Type
Message
Support handles with non-Latin characters and domains with special characters, like @renée@café.example, in mentions, search and profile lookups.