diff options
author | Tim Starling <tstarling@wikimedia.org> | 2022-01-14 09:36:02 +1100 |
---|---|---|
committer | Dduvall <dduvall@wikimedia.org> | 2022-01-13 23:08:56 +0000 |
commit | 758e39cb3d8d54a326e19355869ad1c016f7acad (patch) | |
tree | 7477f745650b92e876046a93027424ea96d35a28 | |
parent | 0156874a1142d0a3005ac4612d947cd311b3245a (diff) |
In WikitextContentHandler always use getFreshParser()
Make it safe to parse articles while in the parser, by always calling
getFreshParser() from WikitextContentHandler.
I think ideally this should be a ParserFactory responsibility, with
Parser instances stored by ParserFactory instead of directly by
ServiceContainer, but this fixes the bug, follows existing conventions,
and does not reduce performance in the usual case.
Bug: T299149
Change-Id: Ibbc1423166f4804a5122de10293ea26f5704d96d
-rw-r--r-- | includes/content/WikitextContentHandler.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/content/WikitextContentHandler.php b/includes/content/WikitextContentHandler.php index 0db146f494a3..492911359de2 100644 --- a/includes/content/WikitextContentHandler.php +++ b/includes/content/WikitextContentHandler.php @@ -290,7 +290,7 @@ class WikitextContentHandler extends TextContentHandler { $revId = $cpoParams->getRevId(); list( $redir, $text ) = $content->getRedirectTargetAndText(); - $output = $services->getParser() + $output = $services->getParser()->getFreshParser() ->parse( $text, $title, $parserOptions, true, true, $revId ); // Add redirect indicator at the top |