SECURITY: rate-limit and prevent blocked users from changing email
[lhc/web/wiklou.git] / includes / MWGrants.php
index ba22590..cbe5a1a 100644 (file)
@@ -58,11 +58,11 @@ class MWGrants {
                // Give grep a chance to find the usages:
                // grant-blockusers, grant-createeditmovepage, grant-delete,
                // grant-editinterface, grant-editmycssjs, grant-editmywatchlist,
-               // grant-editpage, grant-editprotected, grant-highvolume,
-               // grant-oversight, grant-patrol, grant-protect, grant-rollback,
-               // grant-sendemail, grant-uploadeditmovefile, grant-uploadfile,
-               // grant-basic, grant-viewdeleted, grant-viewmywatchlist,
-               // grant-createaccount
+               // grant-editsiteconfig, grant-editpage, grant-editprotected,
+               // grant-highvolume, grant-oversight, grant-patrol, grant-protect,
+               // grant-rollback, grant-sendemail, grant-uploadeditmovefile,
+               // grant-uploadfile, grant-basic, grant-viewdeleted,
+               // grant-viewmywatchlist, grant-createaccount
                $msg = wfMessage( "grant-$grant" );
                if ( $lang !== null ) {
                        if ( is_string( $lang ) ) {
@@ -86,10 +86,8 @@ class MWGrants {
         * @return string[] Corresponding grant descriptions
         */
        public static function grantNames( array $grants, $lang = null ) {
-               if ( $lang !== null ) {
-                       if ( is_string( $lang ) ) {
-                               $lang = Language::factory( $lang );
-                       }
+               if ( $lang !== null && is_string( $lang ) ) {
+                       $lang = Language::factory( $lang );
                }
 
                $ret = [];
@@ -193,12 +191,10 @@ class MWGrants {
         * @return string Wikitext
         */
        public static function getGrantsWikiText( $grantsFilter, $lang = null ) {
-               global $wgContLang;
-
                if ( is_string( $lang ) ) {
                        $lang = Language::factory( $lang );
                } elseif ( $lang === null ) {
-                       $lang = $wgContLang;
+                       $lang = MediaWikiServices::getInstance()->getContentLanguage();
                }
 
                $s = '';