Add support for Number grouping(commafy) based on CLDR number grouping patterns like...
[lhc/web/wiklou.git] / includes / User.php
index 2dba47e..7df864f 100644 (file)
@@ -1076,6 +1076,12 @@ class User {
                        $all = false;
                }
 
+               if ( isset( $row->user_editcount ) ) {
+                       $this->mEditCount = $row->user_editcount;
+               } else {
+                       $all = false;
+               }
+
                if ( isset( $row->user_password ) ) {
                        $this->mPassword = $row->user_password;
                        $this->mNewpassword = $row->user_newpassword;
@@ -1088,7 +1094,6 @@ class User {
                        $this->mEmailToken = $row->user_email_token;
                        $this->mEmailTokenExpires = wfTimestampOrNull( TS_MW, $row->user_email_token_expires );
                        $this->mRegistration = wfTimestampOrNull( TS_MW, $row->user_registration );
-                       $this->mEditCount = $row->user_editcount;
                } else {
                        $all = false;
                }
@@ -1160,6 +1165,7 @@ class User {
                                $log->addEntry( 'autopromote',
                                        $this->getUserPage(),
                                        '', // no comment
+                                       // These group names are "list to texted"-ed in class LogPage.
                                        array( implode( ', ', $oldGroups ), implode( ', ', $newGroups ) )
                                );
                        }
@@ -1208,6 +1214,8 @@ class User {
                }
                $defOpt['skin'] = $wgDefaultSkin;
 
+               wfRunHooks( 'UserGetDefaultOptions', array( &$defOpt ) );
+
                return $defOpt;
        }
 
@@ -3302,7 +3310,7 @@ class User {
 
        /**
         * Internal function to format the e-mail validation/invalidation URLs.
-        * This uses $wgArticlePath directly as a quickie hack to use the
+        * This uses a quickie hack to use the
         * hardcoded English names of the Special: pages, for ASCII safety.
         *
         * @note Since these URLs get dropped directly into emails, using the
@@ -3315,14 +3323,9 @@ class User {
         * @return String Formatted URL
         */
        protected function getTokenUrl( $page, $token ) {
-               global $wgArticlePath;
-               return wfExpandUrl(
-                       str_replace(
-                               '$1',
-                               "Special:$page/$token",
-                               $wgArticlePath ),
-                       PROTO_HTTP
-               );
+               // Hack to bypass localization of 'Special:'
+               $title = Title::makeTitle( NS_MAIN, "Special:$page/$token" );
+               return $title->getCanonicalUrl();
        }
 
        /**
@@ -3474,7 +3477,7 @@ class User {
         *
         * @return Array of Strings List of permission key names for given groups combined
         */
-       public static function getGroupPermissions( $groups, $ns = null ) {
+       public static function getGroupPermissions( array $groups, $ns = null ) {
                global $wgGroupPermissions, $wgRevokePermissions;
                $rights = array();