Page MenuHomePhabricator

Interwiki redirection should preserve request string
Closed, ResolvedPublic

Description

{{fullurl}} only recognizes single interwiki prefixes, so that {{fullurl:w:fr:pomme}} will point to "fr:pomme" on en.wikipedia instead of "pomme" on fr.wikipedia. Since queries are not forwarded, {{fullurl:w:fr:pomme|action=edit}} links to "en.wikipedia.org/w/index.php?title=fr:pomme&action=edit", which redirects to "fr.wikipedia.org/wiki/pomme" (notice the query's disappearance).

Ideally, {{fullurl}} should correctly parse consecutive prefixes; alternatively, wikis should forward the query parameters when redirecting to another wiki.

This is useful for crosswiki link templates that accept input interwiki links.


Version: 1.11.x
Severity: enhancement

Details

Reference
bz10093

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:53 PM
bzimport set Reference to bz10093.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

Well, the problem here is not that MediaWiki's broken, per se, but that users expect multiple interwiki prefixes to resolve at once; the current behaviour relies upon interwiki redirection.

When MediaWiki redirects interwiki'ly, forwarding the full query string would work. Maybe just tack $_SERVER['QUERY_STRING'] to the URI?

Well you'd want to parse it a bit, I imagine... don't want to pass on things like the title parameter. :) You also should check whether the dest URL already includes a query string, and append as necessary.

Quiddity changed the task status from Declined to Resolved.Nov 11 2018, 1:25 AM
Quiddity subscribed.
In T12093#155755, @TTO wrote:

This works now! Yay.

Changing status from Declined to Resolved, per above. :)