Merge "Use {{int:}} on MediaWiki:Blockedtext and MediaWiki:Autoblockedtext"
[lhc/web/wiklou.git] / includes / user / User.php
index ea395f4..e235c18 100644 (file)
@@ -33,13 +33,6 @@ use Wikimedia\Rdbms\Database;
 use Wikimedia\Rdbms\DBExpectedError;
 use Wikimedia\Rdbms\IDatabase;
 
-/**
- * String Some punctuation to prevent editing from broken text-mangling proxies.
- * @deprecated since 1.27, use \MediaWiki\Session\Token::SUFFIX
- * @ingroup Constants
- */
-define( 'EDIT_TOKEN_SUFFIX', Token::SUFFIX );
-
 /**
  * The User object encapsulates all of the user-specific settings (user_id,
  * name, rights, email address, options, last login time). Client
@@ -66,7 +59,7 @@ class User implements IDBAccessObject, UserIdentity {
         * magic can be used.
         * @deprecated since 1.27, use \MediaWiki\Session\Token::SUFFIX
         */
-       const EDIT_TOKEN_SUFFIX = EDIT_TOKEN_SUFFIX;
+       const EDIT_TOKEN_SUFFIX = Token::SUFFIX;
 
        /**
         * @const int Serialized record version.
@@ -421,7 +414,8 @@ class User implements IDBAccessObject, UserIdentity {
                                break;
                        case 'actor':
                                // Make sure this thread sees its own changes
-                               if ( wfGetLB()->hasOrMadeRecentMasterChanges() ) {
+                               $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
+                               if ( $lb->hasOrMadeRecentMasterChanges() ) {
                                        $flags |= self::READ_LATEST;
                                        $this->queryFlagsUsed = $flags;
                                }
@@ -4566,7 +4560,7 @@ class User implements IDBAccessObject, UserIdentity {
         * site.
         *
         * @param string $val Input value to compare
-        * @param string $salt Optional function-specific data for hashing
+        * @param string|array $salt Optional function-specific data for hashing
         * @param WebRequest|null $request Object to use or null to use $wgRequest
         * @param int $maxage Fail tokens older than this, in seconds
         * @return bool Whether the token matches
@@ -4580,7 +4574,7 @@ class User implements IDBAccessObject, UserIdentity {
         * ignoring the suffix.
         *
         * @param string $val Input value to compare
-        * @param string $salt Optional function-specific data for hashing
+        * @param string|array $salt Optional function-specific data for hashing
         * @param WebRequest|null $request Object to use or null to use $wgRequest
         * @param int $maxage Fail tokens older than this, in seconds
         * @return bool Whether the token matches
@@ -5669,11 +5663,12 @@ class User implements IDBAccessObject, UserIdentity {
        /**
         * Checks if two user objects point to the same user.
         *
-        * @since 1.25
-        * @param User $user
+        * @since 1.25 ; takes a UserIdentity instead of a User since 1.32
+        * @param UserIdentity $user
         * @return bool
         */
-       public function equals( User $user ) {
+       public function equals( UserIdentity $user ) {
+               // XXX it's not clear whether central ID providers are supposed to obey this
                return $this->getName() === $user->getName();
        }
 }