Page MenuHomePhabricator

wfExpandUrl() should expand relative URLs again
Closed, DeclinedPublic

Description

In a fix to T34168 (bug 32168) rSVN103208 in line 458 introduced a case where relative URL (the one NOT containing "/") will *not* be expanded with $wgServer.

This caused T39868 (bug 37868) as well as ancillary issue with T40048 (bug 38048, wrong redirect).

I believe this behaviour should be reinstated.

Details

Reference
bz54950

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:39 AM
bzimport set Reference to bz54950.
bzimport added a subscriber: Unknown Object (MLST).

Change 87482 had a related patch set uploaded by saper:
wfExpandUrl should expand relative URLs, too

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

Krinkle added a subscriber: tstarling.

Declining this task. Expansion of relative urls seems problematic. Even if we could provide the document context reliably, there'd be too many ways to trigger code without a proper context (API, Maintenance scripts etc.). Relative paths need to be given to the browser as-is and used there, if meant to be relative.

If not meant to be relative, they need to be adjusted in the calling code before reaching wfExpandUrl(). For expansion between two internal paths, we do have Wikimedia\RelPath which may proof useful.

It's not technically correct to expand a path-relative URL as if it were relative to the server root -- it should be relative to the path of the current document. Presumably the difficulty of implementing path-relative URL expansion is the reason why it was originally omitted from the function.