Page MenuHomePhabricator

Pages that autofill the username of an account get cut off with usernames that contain '?' within it
Closed, DeclinedPublic

Description

I've noticed this issue for some time, but I'm creating this ticket now after I ran into it and when the "cutoff" resulted in pointing to a user account that, by coincidence, existed.

When navigating to certain special pages or even some pages, usernames that contain a '?' within the string will be interpreted as part of the HTML as a parameter and hence gets cut off and removed from the input into the appropriate field. The issue looks to involve the MediaWiki software and its interpretation of URL input when you navigate to pages that involve usernames that contain a '?' somewhere, and may possibly affect usernames with other certain characters within them that are interpreted as part of the HTML link.

For example: If you navigate to the following pages, you'll see what I'm talking about:

In each case, the URL itself isn't altered at all (at least in my browser; I'm using Firefox), but the MediaWiki software cuts off the username at the '?' thinking incorrectly that this portion of the URL is a parameter being passed to the page, resulting in only the "Wantsex" portion of the username being automatically filled into the appropriate filter or username input text field. Don't get me wrong, I'm sure that this "cutoff" is needed for certain links and pages to navigate users properly, but in these cases it's causing issues at times.

Creating a phab ticket to document the issue and have it looked into.

Event Timeline

Oshwah created this task.Jan 24 2019, 9:30 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 24 2019, 9:30 AM

Noting that the behaviour is (unsurprisingly) the same in Chromium and that the workaround of replacing the ? in the url with %3f exists but (a) this is cumbersome, (b) you need to spot you need to do it, (c) you need to know and remember the encoding.

MediaWiki is encoding the ? to %3F when using it in forms.

When visiting https://en.wikipedia.org/wiki/User:A%3fmark all links to further pages (like talk page) are with %3f and working.

So when your input in the search bar or the on Special:Contributions is "User:A?mark" you would land on the correct page with %3f in the url. When typing the username yourself in the browser address bar, than the browers send it as parameter. But that is correct in my opinion and outside of the scope of mediawiki.

So the question is, how the url in your post are created and why that is not encoding the question mark?

The '?' must be parsed as a separator for parameters, rather than as part of the page title:

Imagine that there was a user called "Blah?action=edit" (this is a valid username in MediaWiki, although I think some local blacklist prevents its creation on en.wp). If you were to visit https://en.wikipedia.org/wiki/User:Blah?action=edit, the URL would be ambiguous: do you want to edit the userpage of user "Blah", or view the userpage of user "Blah?action=edit"? The character '?' must therefore always be interpreted the same, and for consistency with URL standards, the first interpretation was chosen.

As @Umherirrender mentions, you can easily reach the correct URLs for such usernames by pasting the page title into the wiki's search field, rather than directly into the page URL.

I think this task is invalid, unless MediaWiki itself produces such incorrect URLs somewhere.

Oshwah added a comment.Feb 7 2019, 1:34 AM

@matmarex - That is correct. I believe that the '?' is being parsed as a separator for URL parameters and not part of the page title when interpreted by the Wikimedia Software. I tried explaining this thought in the details when I created the ticket - my apologies if my thoughts were not clear or worded with proper terminology.

I don't understand what behavior you expect, especially when actual URL parameters are also provided.

Aklapper changed the task status from Open to Stalled.Mar 2 2019, 5:28 PM

@Oshwah: Please provide a specific and not user generated MediaWiki page that offers a "non working" link like one of those URLs that you posted above.
The URL mentions "pages that autofill the username" but I don't see any URL here for a MediaWiki page which itself offers links to such affected pages.

If this is about user-generated posts which include such links then there is nothing to fix in MediaWiki. It's like https://en.wikipedia.org/wiki/Help:URL#Fixing_links_with_unsupported_characters : ? delimits URL components (see RFC 3986) and you can avoid that by encoding as %3F.

Aklapper closed this task as Declined.Mar 24 2019, 4:18 PM

Unfortunately closing this report as no further information has been provided.

@Oshwah: After you have provided the information asked for and if this still happens, please set the status of this report back to "Open" via the Add Action...Change Status dropdown. Thanks!

Oshwah added a comment.Apr 2 2019, 1:29 AM

@Aklapper - Please accept my apologies for the delay responding to your post above. When you ask for a specific but not user-generated MediaWiki page that breaks like this, I'm not exactly sure as to what you're asking. Were those URLs I originally posted in the ticket description not what you're looking for? What are examples of pages you would like me to locate that break like this?

Aklapper added a comment.EditedApr 5 2019, 12:07 PM

@Oshwah: I don't see any URLs listed which include/provide links to those URLs listed above. I asked because I'd like to understand how you ended up on the pages that you linked above.