mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-11-13 17:51:35 +00:00
Merge "replaceAll.php: Replace get_class with instanceof"
This commit is contained in:
commit
e8c50add4e
|
@ -30,6 +30,7 @@
|
||||||
namespace MediaWiki\Extension\ReplaceText;
|
namespace MediaWiki\Extension\ReplaceText;
|
||||||
|
|
||||||
use Maintenance;
|
use Maintenance;
|
||||||
|
use MediaWiki\User\User;
|
||||||
use MWException;
|
use MWException;
|
||||||
|
|
||||||
$IP = getenv( 'MW_INSTALL_PATH' ) ?: __DIR__ . '/../../..';
|
$IP = getenv( 'MW_INSTALL_PATH' ) ?: __DIR__ . '/../../..';
|
||||||
|
@ -112,7 +113,7 @@ class ReplaceAll extends Maintenance {
|
||||||
$userFactory->newFromId( $userReplacing ) :
|
$userFactory->newFromId( $userReplacing ) :
|
||||||
$userFactory->newFromName( $userReplacing );
|
$userFactory->newFromName( $userReplacing );
|
||||||
|
|
||||||
if ( get_class( $user ) !== 'User' ) {
|
if ( !$user instanceof User ) {
|
||||||
$this->fatalError(
|
$this->fatalError(
|
||||||
"Couldn't translate '$userReplacing' to a user."
|
"Couldn't translate '$userReplacing' to a user."
|
||||||
);
|
);
|
||||||
|
@ -437,7 +438,7 @@ EOF;
|
||||||
$this->botEdit = true;
|
$this->botEdit = true;
|
||||||
}
|
}
|
||||||
if ( !$this->getReply(
|
if ( !$this->getReply(
|
||||||
"Attribute changes to the user '{$this->user}'?$comment"
|
"Attribute changes to the user '{$this->user->getName()}'?$comment"
|
||||||
) ) {
|
) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue