X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FSpecialPage.php;h=816831fa3fe9bd8850c43e5c48bdc5347a5659c1;hb=56f00409ea5f1e81b186f929c88c2c1bb4b5a0c8;hp=2e5e02b0fcb97ee5126ac9cf65553211c5005eac;hpb=b0cb8e159236e8e57edcc36f0f1dfb303a5acf11;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 2e5e02b0fc..816831fa3f 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -105,19 +105,6 @@ class SpecialPage { return SpecialPageFactory::resolveAlias( $alias ); } - /** - * Add a page to the list of valid special pages. This used to be the preferred - * method for adding special pages in extensions. It's now suggested that you add - * an associative record to $wgSpecialPages. This avoids autoloading SpecialPage. - * - * @param $page SpecialPage - * @deprecated since 1.7, warnings in 1.17, might be removed in 1.20 - */ - static function addPage( &$page ) { - wfDeprecated( __METHOD__, '1.7' ); - SpecialPageFactory::getList()->{$page->mName} = $page; - } - /** * Add a page to a certain display group for Special:SpecialPages * @@ -267,6 +254,7 @@ class SpecialPage { * * @param $name String * @param $subpage String|Bool subpage string, or false to not use a subpage + * @throws MWException * @return Title object */ public static function getTitleFor( $name, $subpage = false ) { @@ -363,6 +351,7 @@ class SpecialPage { * * @param $fName String Name of called method * @param $a Array Arguments to the method + * @throws MWException * @deprecated since 1.17, call parent::__construct() */ public function __call( $fName, $a ) { @@ -532,9 +521,8 @@ class SpecialPage { * pages? */ public function isRestricted() { - global $wgGroupPermissions; // DWIM: If all anons can do something, then it is not restricted - return $this->mRestriction != '' && empty( $wgGroupPermissions['*'][$this->mRestriction] ); + return $this->mRestriction != '' && !User::groupHasPermission( '*', $this->mRestriction ); } /** @@ -945,8 +933,8 @@ abstract class FormSpecialPage extends SpecialPage { * Called from execute() to check if the given user can perform this action. * Failures here must throw subclasses of ErrorPageError. * @param $user User + * @throws UserBlockedError * @return Bool true - * @throws ErrorPageError */ protected function checkExecutePermissions( User $user ) { $this->checkPermissions(); @@ -1029,14 +1017,12 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage { if ( $redirect instanceof Title ) { $url = $redirect->getFullUrl( $query ); $this->getOutput()->redirect( $url ); - wfProfileOut( __METHOD__ ); return $redirect; // Redirect to index.php with query parameters } elseif ( $redirect === true ) { global $wgScript; $url = $wgScript . '?' . wfArrayToCGI( $query ); $this->getOutput()->redirect( $url ); - wfProfileOut( __METHOD__ ); return $redirect; } else { $class = __CLASS__; @@ -1221,7 +1207,7 @@ abstract class RedirectSpecialArticle extends RedirectSpecialPage { 'ctype', 'maxage', 'smaxage', ); - wfRunHooks( "RedirectSpecialArticleRedirectParams", array(&$redirectParams) ); + wfRunHooks( "RedirectSpecialArticleRedirectParams", array( &$redirectParams ) ); $this->mAllowedRedirectParams = $redirectParams; } }