X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecialpage%2FRedirectSpecialPage.php;h=ea7d7831480282bfd7042989eae78291b8b0a5d2;hb=5b3fd5a4a974b1c7bca43d2032986f9630a4d6c5;hp=9129ee5d42760bf23c61aae1c9302293d08c6abb;hpb=f4770c54d4d92c4aeeaee89d2219fe242e8699bb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/RedirectSpecialPage.php b/includes/specialpage/RedirectSpecialPage.php index 9129ee5d42..ea7d783148 100644 --- a/includes/specialpage/RedirectSpecialPage.php +++ b/includes/specialpage/RedirectSpecialPage.php @@ -28,10 +28,10 @@ */ abstract class RedirectSpecialPage extends UnlistedSpecialPage { // Query parameters that can be passed through redirects - protected $mAllowedRedirectParams = array(); + protected $mAllowedRedirectParams = []; // Query parameters added by redirects - protected $mAddedRedirectParams = array(); + protected $mAddedRedirectParams = []; /** * @param string|null $subpage @@ -73,11 +73,11 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage { * @return array|bool */ public function getRedirectQuery() { - $params = array(); + $params = []; $request = $this->getRequest(); foreach ( array_merge( $this->mAllowedRedirectParams, - array( 'uselang', 'useskin', 'debug' ) // parameters which can be passed to all pages + [ 'uselang', 'useskin', 'debug' ] // parameters which can be passed to all pages ) as $arg ) { if ( $request->getVal( $arg, null ) !== null ) { $params[$arg] = $request->getVal( $arg ); @@ -94,6 +94,18 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage { ? $params : false; } + + /** + * Indicate if the target of this redirect can be used to identify + * a particular user of this wiki (e.g., if the redirect is to the + * user page of a User). See T109724. + * + * @since 1.27 + * @return bool + */ + public function personallyIdentifiableTarget() { + return false; + } } /** @@ -108,7 +120,7 @@ abstract class SpecialRedirectToSpecial extends RedirectSpecialPage { function __construct( $name, $redirName, $redirSubpage = false, - $allowedRedirectParams = array(), $addedRedirectParams = array() + $allowedRedirectParams = [], $addedRedirectParams = [] ) { parent::__construct( $name ); $this->redirName = $redirName; @@ -196,7 +208,7 @@ abstract class SpecialRedirectToSpecial extends RedirectSpecialPage { abstract class RedirectSpecialArticle extends RedirectSpecialPage { function __construct( $name ) { parent::__construct( $name ); - $redirectParams = array( + $redirectParams = [ 'action', 'redirect', 'rdfrom', # Options for preloaded edits @@ -210,9 +222,9 @@ abstract class RedirectSpecialArticle extends RedirectSpecialPage { 'redlink', # Options for action=raw; missing ctype can break JS or CSS in some browsers 'ctype', 'maxage', 'smaxage', - ); + ]; - Hooks::run( "RedirectSpecialArticleRedirectParams", array( &$redirectParams ) ); + Hooks::run( "RedirectSpecialArticleRedirectParams", [ &$redirectParams ] ); $this->mAllowedRedirectParams = $redirectParams; } }