Page MenuHomePhabricator

mw.util.getUrl should produce working URLs for titles ending in "?"
Closed, ResolvedPublic

Description

  1. Open a page whose title ends in "?". E.g.: https://test.wikipedia.org/wiki/Bug%3F
  2. Run the following in the console:
window.open( mw.util.getUrl( null, { action: 'history' } ), '_self' )

Expected result
The history of the page is loaded

Actual result
The same page is loaded

Notice that there are differences in the links produced:

Event Timeline

He7d3r created this task.Jan 7 2016, 1:56 PM
He7d3r raised the priority of this task from to Needs Triage.
He7d3r updated the task description. (Show Details)
He7d3r added a project: JavaScript.
He7d3r added a subscriber: He7d3r.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptJan 7 2016, 1:56 PM

[Please associate codebase projects when creating tasks - adding MediaWiki-General here. Thanks!]

https://test.wikipedia.org/wiki/Bug%3F?action=history is a perfectly fine URL which should open the history page. It looks like Wikimedia has misconfigured rewrite rules (or whatever). A similar one, also generated by mw.util.getUrl(), works for me locally (http://localhost/w/index.php/Bug%3F?action=history).

He7d3r set Security to None.

As of https://gerrit.wikimedia.org/r/281382, mw.util.getUrl() no longer generates this type of url (which is desirable and consistent with other things as well). It doesn't resolve this issue however for manually constructed urls. Though that issue might be specific to Wikimedia's configuration as @matmarex points out.

Krinkle closed this task as Resolved.Apr 28 2017, 9:59 PM
Krinkle claimed this task.

Marking as resolved, as per the previous comment, mw.util.getUrl() now produces urls that will work even with this server bug.

The task about this server bug at Wikimedia is T123276: URL parameters do not work with pages that have "?" in their names.