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 fc7a88124e)
This commit is contained in:
Alexander Vorwerk 2021-08-25 22:13:32 +02:00 committed by Urbanecm
parent adf3f5885e
commit 190d8b7579

View file

@ -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 );