X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMyRedirectPages.php;h=077fbf15470ca48212428e4bada6838fd4e12639;hb=de8ea9e67b1e8c2dc220cf38972f0ac5d1269971;hp=9b8d52bb32cb68af67e0a07e51f8224e724144db;hpb=2e09c356789bf7569fdfa219827f488976aa16f0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMyRedirectPages.php b/includes/specials/SpecialMyRedirectPages.php index 9b8d52bb32..077fbf1547 100644 --- a/includes/specials/SpecialMyRedirectPages.php +++ b/includes/specials/SpecialMyRedirectPages.php @@ -30,16 +30,30 @@ * @ingroup SpecialPage */ class SpecialMypage extends RedirectSpecialArticle { - function __construct() { + public function __construct() { parent::__construct( 'Mypage' ); } - function getRedirect( $subpage ) { - if ( strval( $subpage ) !== '' ) { - return Title::makeTitle( NS_USER, $this->getUser()->getName() . '/' . $subpage ); - } else { + /** + * @param string|null $subpage + * @return Title + */ + public function getRedirect( $subpage ) { + if ( $subpage === null || $subpage === '' ) { return Title::makeTitle( NS_USER, $this->getUser()->getName() ); } + + return Title::makeTitle( NS_USER, $this->getUser()->getName() . '/' . $subpage ); + } + + /** + * Target identifies a specific User. See T109724. + * + * @since 1.27 + * @return bool + */ + public function personallyIdentifiableTarget() { + return true; } } @@ -49,16 +63,30 @@ class SpecialMypage extends RedirectSpecialArticle { * @ingroup SpecialPage */ class SpecialMytalk extends RedirectSpecialArticle { - function __construct() { + public function __construct() { parent::__construct( 'Mytalk' ); } - function getRedirect( $subpage ) { - if ( strval( $subpage ) !== '' ) { - return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() . '/' . $subpage ); - } else { + /** + * @param string|null $subpage + * @return Title + */ + public function getRedirect( $subpage ) { + if ( $subpage === null || $subpage === '' ) { return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() ); } + + return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() . '/' . $subpage ); + } + + /** + * Target identifies a specific User. See T109724. + * + * @since 1.27 + * @return bool + */ + public function personallyIdentifiableTarget() { + return true; } } @@ -68,15 +96,30 @@ class SpecialMytalk extends RedirectSpecialArticle { * @ingroup SpecialPage */ class SpecialMycontributions extends RedirectSpecialPage { - function __construct() { + public function __construct() { parent::__construct( 'Mycontributions' ); - $this->mAllowedRedirectParams = array( 'limit', 'namespace', 'tagfilter', - 'offset', 'dir', 'year', 'month', 'feed' ); + $this->mAllowedRedirectParams = [ 'limit', 'namespace', 'tagfilter', + 'offset', 'dir', 'year', 'month', 'feed', 'deletedOnly', + 'nsInvert', 'associated', 'newOnly', 'topOnly', 'start', 'end' ]; } - function getRedirect( $subpage ) { + /** + * @param string|null $subpage + * @return Title + */ + public function getRedirect( $subpage ) { return SpecialPage::getTitleFor( 'Contributions', $this->getUser()->getName() ); } + + /** + * Target identifies a specific User. See T109724. + * + * @since 1.27 + * @return bool + */ + public function personallyIdentifiableTarget() { + return true; + } } /** @@ -85,14 +128,28 @@ class SpecialMycontributions extends RedirectSpecialPage { * @ingroup SpecialPage */ class SpecialMyuploads extends RedirectSpecialPage { - function __construct() { + public function __construct() { parent::__construct( 'Myuploads' ); - $this->mAllowedRedirectParams = array( 'limit', 'ilshowall', 'ilsearch' ); + $this->mAllowedRedirectParams = [ 'limit', 'ilshowall', 'ilsearch' ]; } - function getRedirect( $subpage ) { + /** + * @param string|null $subpage + * @return Title + */ + public function getRedirect( $subpage ) { return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() ); } + + /** + * Target identifies a specific User. See T109724. + * + * @since 1.27 + * @return bool + */ + public function personallyIdentifiableTarget() { + return true; + } } /** @@ -101,14 +158,28 @@ class SpecialMyuploads extends RedirectSpecialPage { * @ingroup SpecialPage */ class SpecialAllMyUploads extends RedirectSpecialPage { - function __construct() { + public function __construct() { parent::__construct( 'AllMyUploads' ); - $this->mAllowedRedirectParams = array( 'limit', 'ilsearch' ); + $this->mAllowedRedirectParams = [ 'limit', 'ilsearch' ]; } - function getRedirect( $subpage ) { + /** + * @param string|null $subpage + * @return Title + */ + public function getRedirect( $subpage ) { $this->mAddedRedirectParams['ilshowall'] = 1; return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() ); } + + /** + * Target identifies a specific User. See T109724. + * + * @since 1.27 + * @return bool + */ + public function personallyIdentifiableTarget() { + return true; + } }