Page MenuHomePhabricator

Notification: Dummy title used when section name is a magicword
Closed, ResolvedPublic

Description

Hi,
{F4312689}
It looks like == [[:{{BASEPAGENAME}}]] == section name do strange localisation of the mention in notifications.
Meet on https://fr.wikipedia.org/w/index.php?title=Discussion:OL_TV/Droit_d'auteur
Thanks you

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 27 2016, 5:45 PM
Mattflaschen-WMF renamed this task from Notification: bad localization when section name is a magicword to Notification: Dummy title used when section name is a magicword.Jul 27 2016, 9:13 PM
Etonkovidova added a subscriber: Etonkovidova.EditedJul 28 2016, 6:32 PM

Confirmed in betalabs 1.28.0-alpha (b79a28c). The sample title when used as a section title on wikitext pages produces a dummy title.

Below is the screenshot when the sample title == [[:{{BASEPAGENAME}}]] == was used as a section title and as a topic title on wikitext page and Flow page topic. Flow topics handle it correctly.

Related to T129439: topic-title-plaintext content format to treat topic-title-wikitext as plain text.
Added the title sample to test cases for XSS test cases. Also see, T120324: XSS in Flow topic titles and T128062: Keep notification excerpts compact and meaningful for tested cases on Flow pages.

As @Mattflaschen-WMF says, this may just be a matter of ->plaintextParams(). If that's the case, let's just do this, but if it's a deeper problem around section support, let's put it off. There are other bugs around notifications and section handling and they're mostly due to sections not being very well supported in MediaWiki generally.

SBisson added a subscriber: SBisson.Aug 4 2016, 3:08 PM

It's not about plaintextParams.

This is what DiscussionParser does:

echo MessageCache::singleton()->parse( '[[:{{BASEPAGENAME}}]]' )->getText();

<p><a href="/w/index.php?title=Badtitle/title_not_set_in_MessageCache::parse&amp;action=edit&amp;redlink=1" class="new" title="Badtitle/title not set in MessageCache::parse (page does not exist)">Badtitle/title not set in MessageCache::parse</a>
</p>

Oh, ugh, I see, that's terrible. We'd have to parse it using the correct title somehow.

Change 308115 had a related patch set uploaded (by Sbisson):
Provide title when parsing wikitext

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

SBisson claimed this task.Sep 2 2016, 1:35 AM

Change 308115 merged by jenkins-bot:
Provide title when parsing wikitext

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

Etonkovidova added a comment.EditedSep 2 2016, 7:43 PM

Checked the fix for Flow topic titles and wikitext section titles
Flow topics with == [[:{{BASEPAGENAME}}]] == will display it un-parsed, when wikitext pages will display it as as the page name link in a section title according to https://www.mediawiki.org/wiki/Help:Magic_words#Page_names
@SBisson should it be the same for Flow topics?

jmatazzoni closed this task as Resolved.Sep 12 2016, 8:53 PM