A fairly simple change.
Bug: 58727
Change-Id: Id030728e7c1449f0ff856be10a972bea5bdd18f6
) );
}
+ /**
+ * Handle Special:Redirect/page/xxx (by redirecting to index.php?curid=xxx)
+ *
+ * @return string|null url to redirect to, or null if $mValue is invalid.
+ */
+ function dispatchPage() {
+ $curid = $this->mValue;
+ if ( !ctype_digit( $curid ) ) {
+ return null;
+ }
+ $curid = (int)$curid;
+ if ( $curid === 0 ) {
+ return null;
+ }
+ return wfAppendQuery( wfScript( 'index' ), array(
+ 'curid' => $curid
+ ) );
+ }
+
/**
* Use appropriate dispatch* method to obtain a redirection URL,
* and either: redirect, set a 404 error code and error message,
case 'revision':
$url = $this->dispatchRevision();
break;
+ case 'page':
+ $url = $this->dispatchPage();
+ break;
default:
$this->getOutput()->setStatusCode( 404 );
$url = null;
$mp = $this->getMessagePrefix();
$ns = array(
// subpage => message
- // Messages: redirect-user, redirect-revision, redirect-file
+ // Messages: redirect-user, redirect-page, redirect-revision,
+ // redirect-file
'user' => $mp . '-user',
+ 'page' => $mp . '-page',
'revision' => $mp . '-revision',
'file' => $mp . '-file',
);
'version-entrypoints-load-php' => '[https://www.mediawiki.org/wiki/Manual:load.php load.php]', # do not translate or duplicate this message to other languages
# Special:Redirect
-'redirect' => 'Redirect by file, user, or revision ID',
+'redirect' => 'Redirect by file, user, page or revision ID',
'redirect-legend' => 'Redirect to a file or page',
'redirect-text' => '', # do not translate or duplicate this message to other languages
-'redirect-summary' => 'This special page redirects to a file (given the file name), a page (given a revision ID), or a user page (given a numeric user ID). Usage: [[{{#Special:Redirect}}/file/Example.jpg]], [[{{#Special:Redirect}}/revision/328429]], or [[{{#Special:Redirect}}/user/101]].',
+'redirect-summary' => 'This special page redirects to a file (given the file name), a page (given a revision ID or page ID), or a user page (given a numeric user ID). Usage: [[{{#Special:Redirect}}/file/Example.jpg]], [[{{#Special:Redirect}}/page/64308]], [[{{#Special:Redirect}}/revision/328429]], or [[{{#Special:Redirect}}/user/101]].',
'redirect-submit' => 'Go',
'redirect-lookup' => 'Lookup:',
'redirect-value' => 'Value:',
'redirect-user' => 'User ID',
'redirect-revision' => 'Page revision',
+'redirect-page' => 'Page ID',
'redirect-file' => 'File name',
'redirect-not-exists' => 'Value not found',
# Special:Redirect
'redirect' => "{{doc-special|Redirect}}
-This means \"Redirect by file'''name''', user '''ID''', or revision ID\".",
+This means \"Redirect by file'''name''', user '''ID''', page ID, or revision ID\".",
'redirect-legend' => 'Legend of fieldset around input box in [[Special:Redirect]]',
'redirect-summary' => 'Shown at top of [[Special:Redirect]]',
'redirect-submit' => 'Button label in [[Special:Redirect]].
Followed by the select box which has the following options:
* {{msg-mw|Redirect-user}}
+* {{msg-mw|Redirect-page}}
* {{msg-mw|Redirect-revision}}
* {{msg-mw|Redirect-file}}',
'redirect-value' => 'Second field label in [[Special:Redirect]]
{{Identical|Value}}',
'redirect-user' => 'Description of lookup type for [[Special:Redirect]].
{{Identical|User ID}}',
+'redirect-page' => 'Description of lookup type for [[Special:Redirect]].',
'redirect-revision' => "Description of lookup type for [[Special:Redirect]].
This means \"Page revision '''ID'''\".",
'redirect-lookup',
'redirect-value',
'redirect-user',
+ 'redirect-page',
'redirect-revision',
'redirect-file',
'redirect-not-exists',