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;
}
if ( self::isLocallyBlockedProxy( $ip ) ) {
$block = new Block( [
'byText' => wfMessage( 'proxyblocker' )->text(),
- 'reason' => wfMessage( 'proxyblockreason' )->text(),
+ 'reason' => wfMessage( 'proxyblockreason' )->plain(),
'address' => $ip,
'systemBlock' => 'proxy',
] );
} elseif ( $this->isAnon() && $this->isDnsBlacklisted( $ip ) ) {
$block = new Block( [
'byText' => wfMessage( 'sorbs' )->text(),
- 'reason' => wfMessage( 'sorbsreason' )->text(),
+ 'reason' => wfMessage( 'sorbsreason' )->plain(),
'address' => $ip,
'systemBlock' => 'dnsbl',
] );
if ( $block instanceof Block ) {
# Mangle the reason to alert the user that the block
# originated from matching the X-Forwarded-For header.
- $block->mReason = wfMessage( 'xffblockreason', $block->mReason )->text();
+ $block->mReason = wfMessage( 'xffblockreason', $block->mReason )->plain();
}
}
$block = new Block( [
'address' => $ip,
'byText' => 'MediaWiki default',
- 'reason' => wfMessage( 'softblockrangesreason', $ip )->text(),
+ 'reason' => wfMessage( 'softblockrangesreason', $ip )->plain(),
'anonOnly' => true,
'systemBlock' => 'wgSoftBlockRanges',
] );
* 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
* 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
/**
* 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();
}
}