Avoid fatal when thanks ip via Special:Thanks

Bug: T353466
Change-Id: Iac810dc1929b6473c15ec231df0a8f17790991dd
This commit is contained in:
Umherirrender 2024-01-23 22:28:02 +01:00
parent f7c985bb15
commit 40e4bead61

View file

@ -10,6 +10,7 @@ use MediaWiki\Request\DerivativeRequest;
use MediaWiki\SpecialPage\FormSpecialPage;
use MediaWiki\Status\Status;
use MediaWiki\User\UserFactory;
use MediaWiki\User\UserRigorOptions;
class SpecialThanks extends FormSpecialPage {
@ -189,7 +190,7 @@ class SpecialThanks extends FormSpecialPage {
*/
public function onSuccess() {
$sender = $this->getUser();
$recipient = $this->userFactory->newFromName( $this->result['recipient'] );
$recipient = $this->userFactory->newFromName( $this->result['recipient'], UserRigorOptions::RIGOR_NONE );
$link = Linker::userLink( $recipient->getId(), $recipient->getName() );
if ( in_array( $this->type, [ 'rev', 'log' ] ) ) {