Last modified: 2014-01-31 18:31:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T61644, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59644 - Flow: use text() or plain() instead of message parse() where possible
Flow: use text() or plain() instead of message parse() where possible
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Flow (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-04 11:15 UTC by spage
Modified: 2014-01-31 18:31 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description spage 2014-01-04 11:15:52 UTC
While Flow changed anonymous IP handling, blank IP addresses led to topic participants appearing in a white typewriter text block.  This happened because wikitext parsing of a message starting with a blank results in pre-formatted text.  In eval.php,
  echo wfMessage( 'flow-topic-participants', 2, 2, '', 'second person' )->parse();
(note the empty string for first participant); this prints

<pre>and second person
</pre>

We fixed that bug, but it's wasted effort doing this level of wikitext parsing if we don't need to, and it's prone to embarrassing HTML output. Niklas on mediawiki-i18n list commented
  Is there any other wikitext besides the magic words? You could just use ->text() instead of ->parse().

and sure enough if you call text() instead you avoid the additional parsing.  I didn't test this message's complex GENDER handling in a language where it matters, but we should check all our messages using parse() (about 13 of them in PHP) and see if we can switch them to ->text(), or escaped() if they're directly output, or even plain(). See https://www.mediawiki.org/wiki/Manual:Messages_API . Use of parse() where we don't intend to be converting wikitext constructs into HTML seems about 25% slower on this string in my dopey testing, and could cause some display bugs.
Comment 1 Bingle 2014-01-04 11:18:33 UTC
The WMF core features team tracks this bug on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/689, but people from the community are welcome to contribute here and in Gerrit.
Comment 2 Gerrit Notification Bot 2014-01-04 11:48:11 UTC
Change 105435 had a related patch set uploaded by Spage:
Call msg ->text() or escaped() instead of parse()

https://gerrit.wikimedia.org/r/105435
Comment 3 Gerrit Notification Bot 2014-01-14 17:00:06 UTC
Change 105435 merged by jenkins-bot:
Call msg ->text() or escaped() instead of parse()

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links