X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialRedirect.php;h=774fd80ca2bfeb80e302172b2782332face4b615;hb=fa16b9fddf3ae05601b335c8709fa28b1d5430e6;hp=4926d6dd18dd177ce369c2d2dc93869fc73e2c76;hpb=88428ee2ff6b0fa8aa08e0ab33a35d324514bb8b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialRedirect.php b/includes/specials/SpecialRedirect.php index 4926d6dd18..553e2b1235 100644 --- a/includes/specials/SpecialRedirect.php +++ b/includes/specials/SpecialRedirect.php @@ -2,7 +2,6 @@ /** * Implements Special:Redirect * - * @section LICENSE * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -55,6 +54,7 @@ class SpecialRedirect extends FormSpecialPage { /** * Set $mType and $mValue based on parsed value of $subpage. + * @param string $subpage */ function setParameter( $subpage ) { // parse $subpage to pull out the parts @@ -66,7 +66,7 @@ class SpecialRedirect extends FormSpecialPage { /** * Handle Special:Redirect/user/xxxx (by redirecting to User:YYYY) * - * @return string|null url to redirect to, or null if $mValue is invalid. + * @return string|null Url to redirect to, or null if $mValue is invalid. */ function dispatchUser() { if ( !ctype_digit( $this->mValue ) ) { @@ -85,7 +85,7 @@ class SpecialRedirect extends FormSpecialPage { /** * Handle Special:Redirect/file/xxxx * - * @return string|null url to redirect to, or null if $mValue is not found. + * @return string|null Url to redirect to, or null if $mValue is not found. */ function dispatchFile() { $title = Title::makeTitleSafe( NS_FILE, $this->mValue ); @@ -121,7 +121,7 @@ class SpecialRedirect extends FormSpecialPage { * Handle Special:Redirect/revision/xxx * (by redirecting to index.php?oldid=xxx) * - * @return string|null url to redirect to, or null if $mValue is invalid. + * @return string|null Url to redirect to, or null if $mValue is invalid. */ function dispatchRevision() { $oldid = $this->mValue; @@ -141,7 +141,7 @@ class SpecialRedirect extends FormSpecialPage { /** * 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. + * @return string|null Url to redirect to, or null if $mValue is invalid. */ function dispatchPage() { $curid = $this->mValue; @@ -164,7 +164,7 @@ class SpecialRedirect extends FormSpecialPage { * or do nothing (if $mValue wasn't set) allowing the form to be * displayed. * - * @return bool true if a redirect was successfully handled. + * @return bool True if a redirect was successfully handled. */ function dispatch() { // the various namespaces supported by Special:Redirect @@ -262,6 +262,34 @@ class SpecialRedirect extends FormSpecialPage { $form->setMethod( 'get' ); } + /** + * Return an array of subpages that this special page will accept. + * + * @return string[] subpages + */ + protected function getSubpagesForPrefixSearch() { + return array( + 'file', + 'page', + 'revision', + 'user', + ); + } + + /** + * @return bool + */ + public function requiresWrite() { + return false; + } + + /** + * @return bool + */ + public function requiresUnblock() { + return false; + } + protected function getGroupName() { return 'redirects'; }