Page MenuHomePhabricator

Malformed URI on certain red links on page load
Closed, ResolvedPublicPRODUCTION ERROR

Description

115 errors in last 7 days (https://logstash.wikimedia.org/goto/73afc1451a6db1bab59fdcd65be1088f)
Potential to spike and cause significant logspam if added to a popular page.

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

What happens?:

load.php:802 Uncaught URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at Object.newFromUri (load.php:802:846)
    at isUserUri (load.php:776:463)
    at HTMLAnchorElement.<anonymous> (load.php:778:523)
    at load.php:375:499
    at jQuery.grep (load.php:345:363)
    at winnow (load.php:375:450)
    at jQuery.fn.init.filter (load.php:376:437)
    at load.php:778:502
    at Object.add (load.php:575:479)

Can replicate with

TitleUtil.newFromUri("https://ru.wikipedia.org/wiki/K@?action=edit&redlink=1#%C3%B8%!")

What should have happened instead?:

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

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

To fix this you'll need to get setup with MediaWiki and Minerva.

Event Timeline

Restricted Application changed the subtype of this task from "Bug Report" to "Production Error". · View Herald TranscriptApr 29 2026, 5:09 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdlrobson-WMF renamed this task from Malformed URI on certain red links to Malformed URI on certain red links on page load.Apr 29 2026, 5:11 PM
Jdlrobson-WMF updated the task description. (Show Details)

Thank you for tagging this task with good first task for Wikimedia newcomers!

Newcomers often may not be aware of things that may seem obvious to seasoned contributors, so please take a moment to reflect on how this task might look to somebody who has never contributed to Wikimedia projects.

A good first task is a self-contained, non-controversial task with a clear approach. It should be well-described with pointers to help a completely new contributor, for example it should clearly point to the codebase URL and provide clear steps to help a contributor get set up for success. We've included some guidelines at https://phabricator.wikimedia.org/tag/good_first_task/ !

Thank you for helping us drive new contributions to our projects <3

Submitted a patch to handle malformed URI fragments in TitleUtil.newFromUri() and prevent URIError exceptions caused by malformed red-link fragments.

Gerrit change: https://gerrit.wikimedia.org/r/c/mediawiki/skins/MinervaNeue/+/1287961

Change #1287961 had a related patch set uploaded (by Jdlrobson; author: Gkm563):

[mediawiki/skins/MinervaNeue@master] Handle malformed URI fragments in TitleUtil

https://gerrit.wikimedia.org/r/1287961

Change #1287961 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Handle malformed URI fragments in TitleUtil

https://gerrit.wikimedia.org/r/1287961

Jdlrobson-WMF added a subscriber: HakanIST.

I've confirmed the fix. No issues with the URL in the example and no issues since the latest MediaWiki release:

Screenshot 2026-05-21 at 12.01.47 PM.png (2,710×584 px, 108 KB)

Thanks again @Gkm563 and @HakanIST for helping us get this bug fixed!