Page MenuHomePhabricator

[[?oldid=851713451]] is a valid link in the new preview, but not when the page is saved
Closed, ResolvedPublic

Description

This URL works: https://en.wikipedia.org/wiki/?oldid=851713451

This redlink currently does not: [[?oldid=851713451]]

If you put that into the 2017WTE and preview your changes, it displays it as a red link but you can still click on it and reach the correct page.

I wonder whether the (new) preview should be changed to match the (old) parser, or if this should be an acceptable internal link style.

Event Timeline

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

At the moment, I'm leaning towards having [[?oldid=851713451]] work as valid link syntax. Then we could get rid of {{oldid}}-type templates, and it would be easy to link to previous revisions everywhere. However, perhaps it would create problems that I haven't thought of yet.

"?oldid=851713451" is a valid page title. For the wikitext [[?oldid=851713451]], Parsoid generates a correct link to https://en.wikipedia.org/wiki/%3Foldid=851713451. PHP Parser generates a link to https://en.wikipedia.org/w/index.php?title=%3Foldid%3D851713451&action=edit&redlink=1 – if you're logged out (and can't create pages), this redirects to https://en.wikipedia.org/wiki/%3Foldid%3D851713451. Note that the '?' character is URL-encoded.

These URLs incorrectly give the same result as https://en.wikipedia.org/wiki/?oldid=851713451 (with '?' not encoded). They should give the same result as https://en.wikipedia.org/w/index.php?title=%3Foldid=851713451 (which is a non-existent page, but the title is valid), but our servers are misconfigured: T132629.

At the moment, I'm leaning towards having [[?oldid=851713451]] work as valid link syntax. Then we could get rid of {{oldid}}-type templates, and it would be easy to link to previous revisions everywhere. However, perhaps it would create problems that I haven't thought of yet.

We can't do that unless we disallow the character '?' in page titles (or maybe disallow that specific pattern), since "?oldid=851713451" is currently a valid page title and we must be able to link to it. I don't think we should do it. Note that you can also link to a specific revision using [[Special:PermanentLink/851713451]].

Deskana moved this task from To Triage to Freezer on the VisualEditor board.

I can't reproduce this problem any more. A link like [[?oldid=851713451]] now behaves as a link to the non-existent page in all modes. I assume this was fixed by migrating to PHP 7 (T176370).