Page MenuHomePhabricator

wfExpandUrl() should expand relative URLs again
Closed, DeclinedPublic


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.



Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 2:39 AM
bzimport added a project: MediaWiki-General.
bzimport set Reference to bz54950.
bzimport added a subscriber: Unknown Object (MLST).
saper created this task.Oct 3 2013, 11:32 PM

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

Krinkle updated the task description. (Show Details)Jul 18 2018, 1:14 AM
Krinkle removed a subscriber: wikibugs-l-list.
Krinkle closed this task as Declined.Jul 18 2018, 1:39 AM
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.