Page MenuHomePhabricator
Paste P8361

SpecialMobileHistory-redirect.php
ActivePublic

Authored by Krinkle on Apr 6 2019, 12:47 AM.
Tags
None
Referenced Files
F28590716: raw.txt
Apr 6 2019, 12:47 AM
Subscribers
<?php
/**
* Compatibility redirect from "Special:History/#" to "index.php?title=#&action=history".
* This used to be a custom version (T216420).
* @ingroup SpecialPage
*/
class SpecialMobileHistory extends RedirectSpecialPage {
// Pass the paging offset along (MW timestamp format).
protected $mAllowedRedirectParams = [ 'offset' ];
public function __construct() {
parent::__construct( 'History' );
}
/** @param string|null $subpage */
public function execute( $subpage ) {
$query = array_merge(
[
// The receiver (index.php) decides the default title,
// when $title is null (omitted by wfAppendQuery).
'title' => $title,
'action' => 'history',
],
parent::getRedirectQuery() ?: []
);
$url = wfAppendQuery( wfScript( 'index' ), $query );
$this->getOutput()->redirect( $url );
}
/** @return bool */
public function getRedirect( $subpage ) {
return true;
}
}