Page MenuHomePhabricator

Echo double-encodes URI 'fragment' part when removing the 'markasread' parameter
Closed, ResolvedPublic

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

We're not doing anything weird in Echo:

// Remove ?markasread=XYZ from the URL
var uri = new mw.Uri();
if ( uri.query.markasread !== undefined ) {
        delete uri.query.markasread;
        window.history.replaceState( null, document.title, uri );
}

So I strongly suspect this is a bug in mw.Uri.

Change 405377 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/core@master] mediawiki.Uri: Don't double-escape fragments

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

Change 405377 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.Uri: Don't double-escape fragments

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

Checked the fix in testwiki (wmf.20) - no double-encoding in URI when markasread is removed.