From a0a0c3ee7ec403615a689e300cdb502f7623d551 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 20 Jun 2022 16:51:19 +1000 Subject: [PATCH] In ScribuntoContentHandler use the new ParserFactory::getInstance() To avoid an exception when the parser is re-entered. Bug: T310948 Depends-On: I762b191e978c2d1bbc9f332c9cfa047888ce2e67 Change-Id: I5013ed2a2958c3ff422778f9146f663aff0f5939 --- extension.json | 2 +- includes/ScribuntoContentHandler.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extension.json b/extension.json index 2796bfc3..425d51a2 100644 --- a/extension.json +++ b/extension.json @@ -10,7 +10,7 @@ "license-name": "GPL-2.0-or-later AND MIT", "type": "parserhook", "requires": { - "MediaWiki": ">= 1.38.0" + "MediaWiki": ">= 1.39.0" }, "APIModules": { "scribunto-console": "MediaWiki\\Extension\\Scribunto\\ApiScribuntoConsole" diff --git a/includes/ScribuntoContentHandler.php b/includes/ScribuntoContentHandler.php index 1ba9a349..7e61472a 100644 --- a/includes/ScribuntoContentHandler.php +++ b/includes/ScribuntoContentHandler.php @@ -114,7 +114,7 @@ class ScribuntoContentHandler extends CodeContentHandler { $parserOptions = $cpoParams->getParserOptions(); $revId = $cpoParams->getRevId(); $generateHtml = $cpoParams->getGenerateHtml(); - $parser = MediaWikiServices::getInstance()->getParser(); + $parser = MediaWikiServices::getInstance()->getParserFactory()->getInstance(); $text = $content->getText(); // Get documentation, if any