specials: Add $subpage param to RedirectSpecialPage::getRedirectQuery
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 6 Apr 2019 00:50:55 +0000 (01:50 +0100)
committerKrinkle <krinklemail@gmail.com>
Mon, 15 Apr 2019 14:44:38 +0000 (14:44 +0000)
commit7ac7ffc2b3c4d093d1fe9d4e0d19bfd28dbde851
tree5d44dfff24934a182a52b7e5476059fee80a4c19
parente22a3f516b5cfd7ac93419e17a14431bab138d03
specials: Add $subpage param to RedirectSpecialPage::getRedirectQuery

This will make it easier to create redirects where $subpage is the title,
e.g. "Special:Example/Foo?x=y" to "index.php?title=Foo&x=y".

To do that conveniently, getRedirectQuery() needs access to $subpage.
The alternative is to do Title-parsing inside getRedirect(), which then
complicates this significantly as one has to deal with absence of a title
(null) and invalid titles (illegal chars etc.).

By using it plainly as query parameter (defaulting to null/omitted), this
is all deferred to index.php, which seems like a better separation of
concerns.

Motivated by SpecialMobileHistory in MobileFrontend (Ic0aea7ee340a).

Change-Id: I9fe78f479053fb55952ba78850d2fc281a039fe3
includes/MediaWiki.php
includes/specialpage/RedirectSpecialPage.php