From 190d8b7579af981cf2f5e4a6d9457ee0a7edca3f Mon Sep 17 00:00:00 2001 From: Alexander Vorwerk Date: Wed, 25 Aug 2021 22:13:32 +0200 Subject: [PATCH] Use Parser::getUserIdentity() instead of ::getUser() in SimpleCaptcha ParserOptions::__construct() and Parser::preSaveTransform() both accept an UserIdentity and don't need a full user object. Bug: T289731 Change-Id: I9e3d3f21452167ae1b1e9dca664605ee471f90e2 (cherry picked from commit fc7a88124e2a2b49e5307592917021a4f1546f9d) --- SimpleCaptcha/SimpleCaptcha.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimpleCaptcha/SimpleCaptcha.php b/SimpleCaptcha/SimpleCaptcha.php index 8e8e41021..8193de68d 100644 --- a/SimpleCaptcha/SimpleCaptcha.php +++ b/SimpleCaptcha/SimpleCaptcha.php @@ -1152,7 +1152,7 @@ class SimpleCaptcha { */ private function findLinks( $title, $text ) { $parser = MediaWikiServices::getInstance()->getParser(); - $user = $parser->getUser(); + $user = $parser->getUserIdentity(); $options = new ParserOptions( $user ); $text = $parser->preSaveTransform( $text, $title, $user, $options ); $out = $parser->parse( $text, $title, $options );