Page MenuHomePhabricator

Action API `prop=extlinks` incorrectly mangles URN links
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Create a page with a URN external link, e.g. [urn:example:Foo:Bar:Baz].
  • Query that page using api.php?action=query&prop=extlinks

What happens?:

It result returns the link with the colon between the NID and NSS incorrectly percent-encoded and the NSS incorrectly converted to lowercase and percent-encoded, e.g.

"extlinks": [
    {
        "*": "urn:example%3Afoo%3Abar%3Abaz"
    }
]

What should have happened instead?:

The returned link should match the original, or at least should be something considered equivalent by RFC 8141 § 3.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

This breaks one of AnomieBOT's tasks on enwiki, see User talk:AnomieBOT#PERTableHelper not finding correct page.

Bisecting locally turns up c7056e8fd879707175af25b1ec394125d24a86a9, so something in the externallinks storage change has broken this. Pinging @Ladsgroup as the person responsible for that work.