Merge "Fix user existence problem"

This commit is contained in:
jenkins-bot 2024-01-11 18:08:15 +00:00 committed by Gerrit Code Review
commit bce8f7501f

View file

@ -53,6 +53,11 @@ class Job extends JobParent {
$services = MediaWikiServices::getInstance();
// T279090
$current_user = $services->getUserFactory()->newFromId( $this->params['user_id'] );
if ( !$current_user->isRegistered() ) {
$this->error = 'replacetext: the user ID ' . $this->params['user_id'] .
' does not belong to a registered user.';
return false;
}
$permissionManager = $services->getPermissionManager();
if ( !$permissionManager->userCan(
'replacetext', $current_user, $this->title