Skip to content

Commit

Permalink
Do not call $parser->clearState() when parser options exist
Browse files Browse the repository at this point in the history
  • Loading branch information
pastakhov committed Mar 20, 2024
1 parent bea8bb0 commit 888b76f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SemanticMW/QueryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,12 @@ private function getTitleOutput( string $titleText ) {
}

private function getParser(): \Parser {
$user = \RequestContext::getMain()->getUser();
$parser = MediaWikiServices::getInstance()->getParser();
if ( !$parser->getOptions() ) {
$user = \RequestContext::getMain()->getUser();
$parser->setOptions( new \ParserOptions( $user ) );
$parser->clearState();
}
$parser->clearState();
return $parser;
}

Expand Down

0 comments on commit 888b76f

Please sign in to comment.