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

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