As documented on Manual:Hooks/OutputPageBeforeHTML, the OutputPageBeforeHTML hook can be executed more than once per page view, if the page content is composed from multiple sources.
For example, if the MediaWiki:Talkpageheader localisation message is defined, it is inserted at the top of all talk pages, and the hook is called twice: for the content from this message and for the content from the page's wikitext. This can be reproduced on e.g. https://fr.m.wikipedia.org/wiki/Discussion:Rhinocéros_de_Louis_XV.
In T323376#8406975, @Tacsipacsi wrote:
- Since DoubleWiki works with interlanguage links, I had to get MediaWiki display interlanguage links in talk namespaces. I could’ve probably written an extension that adds them (or install Wikibase), but the easiest solution was simply modifying Parser.php to remove the $nottalk check from the code recognizing interlanguage links. Isn’t likely to happen in production, but it fits for testing. 🙂
- Created MediaWiki:talkpageheader, calling a template in which I “forgot” to wrap the interlanguage link in <noinclude>.
- Also added a direct interlanguage link to a talk page.
- Opened the talk page with &match=hu added to the URL.
- Got QuadrupleWiki instead of DoubleWiki: both the talk page header and the main content got their Hungarian equivalents – except that sometimes the main content also got the Hungarian equivalent of the talk page header, probably due to cache pollution.
Until someone comes up with a such way to reproduce this that at least doesn’t involve modifying the parser, it’s pretty low-priority, but it’s still a bug.