From 6a484ebd0ab717dbfa9a49d32e0382920942ebbb Mon Sep 17 00:00:00 2001 From: TechieNK Date: Fri, 15 Sep 2023 10:55:09 +0530 Subject: [PATCH] Fix user existence problem Bug: T307069 Change-Id: I4ae3902d88470d9aad434ebc0a87d1e586a54758 --- src/Job.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Job.php b/src/Job.php index c934b948..1e4320a6 100644 --- a/src/Job.php +++ b/src/Job.php @@ -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