Page MenuHomePhabricator

Transcluded Special:RecentChanges and Special:RecentChangesLinked can leave strip markers and overridden title
Closed, ResolvedPublic

Description

Some special pages using OutputPage::wrapWikiMsg (or similar) to add a message, for example when there is no result.

When that special page (for example Special:RecentchangesLinked) get transcluded and there is no result, the whole page shows QINU and has the special page name as title, see the screenshot from a user on dewiki[1][2]

This is happen, because OutputPage::wrapWikiMsg calls OutputPage::addWikiText calls OutputPage::addWikiTextTitle and that finally calls Parser::parse which results in a recursively call of that method and that is not a good idea(CommentDoc contains a note "Do not call this function recursively.")

This means the special page transclusion must be delayed to the end of the parse or reset $wgParser to a own/new parser object)

Is there a idea to avoid that the strip markers are shown, when a special page shows no result? That always annoying users on dewiki.

[1]https://de.wikipedia.org/wiki/Datei:Screenwikibug.png
[2]https://de.wikipedia.org/wiki/Datei:Screenwikibug02.png


Version: 1.22.0
Severity: normal

Details

Reference
bz56167

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:36 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz56167.

First, it's the special page's fault not to use recursiveTagParse() correctly here: Special:RecentchangesLinked needs to be fixed now. See [[mw:Manual:Special pages]].

Second, I wonder whether there's any valid use case to call parse() recursively. If not, can't we check whether parse() is called recursively at the beginning of parse, and throw an exception when so, or to create less fatals, issue a warning, so people can find mistakes easier?

Okay, I will submit a patch to change two calls on Special:RecentChanges and Special:RecentChangesLinked.

Thanks for the hint.

Change 91889 had a related patch set uploaded by Umherirrender:
Avoid strip markes on transcluded Special:RecentChanges[Linked]

https://gerrit.wikimedia.org/r/91889

It sounds like we should instead fix wrapWikiMsg() instead to me (possibly making it not parse the result – I don't recall any usages of it that would actually need parsing, it's always just HTML wrapper).

Change 91889 merged by jenkins-bot:
Avoid strip markes on transcluded Special:RecentChanges[Linked]

https://gerrit.wikimedia.org/r/91889

  • Bug 63715 has been marked as a duplicate of this bug. ***