Page MenuHomePhabricator

Cleanup for Special:Randompage and Special:Randomredirect after r29725
Closed, ResolvedPublic

Description

proposed patch

When trying to get a random page with Special:Randompage post r29725, i get 2 E_STRICT saying that RandomPage::execute() and RandomPage::getRedirect() definitions don't match to the SpecialPage (the parent class) definition and the headers aren't set.
If the headers aren't set, it's because Special:Randompage doesn't call SpecialPage::setHeaders() (implicitely done when using a special page by wfSpecial*) and the parent doesn't recieve the special page name (there is no specific constructor in RandomPage class). I also don't know if overriding SpecialPage::getRedirect() with an other function is a good idea.
I modified Special:Randomredirect to simply create a class that extends RandomPage and replaced RandomPage::$redirect by a function that is overriden by Randomredirect.


Version: 1.12.x
Severity: normal

Attached:

Details

Reference
bz12624

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:07 PM
bzimport set Reference to bz12624.
bzimport added a subscriber: Unknown Object (MLST).