Page MenuHomePhabricator

Convert includes/Feed.php to Mustache templates
Closed, ResolvedPublic

Description

[Note, this is a little more involved than some of the other GCI tasks]

The file includes/Feed.php in MediaWiki core is using php as a templating language.
For example, in RSSFeed::outHeader() it is directly outputting XML mixed with things like <?php print $this->getTitle(); ?>

It also seems to have inconsistent escaping (For example, calling wfExpandUrl() on a value already passed through htmlspecialchars(), where htmlspecialchars() is always supposed to be the last thing you do.

It would be nicer if this used [Mustache](https://en.wikipedia.org/wiki/Mustache_(template_system%29) and was consistently escaped using Mustache's double brace syntax.
See the folder includes/templates for example Mustache templates, and $templateParser->processTemplate() for examples of where Mustache is used in MediaWiki. And https://mustache.github.io/mustache.5.html

Event Timeline

Bawolff created this task.Dec 6 2017, 4:57 PM
Restricted Application added subscribers: TerraCodes, Aklapper. · View Herald TranscriptDec 6 2017, 4:57 PM
Aklapper renamed this task from Convert includes/Feed.php to moustache templates to Convert includes/Feed.php to Mustache templates.Dec 6 2017, 5:42 PM
Aklapper added a project: MediaWiki-General.
Aklapper updated the task description. (Show Details)
Pppery updated the task description. (Show Details)Dec 10 2017, 10:45 PM

Change 397724 had a related patch set uploaded (by Pppery; owner: Pppery):
[mediawiki/core@master] Convert includes/Feed.php to Mustache templates

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

Change 397724 merged by jenkins-bot:
[mediawiki/core@master] Convert includes/Feed.php to Mustache templates

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

Bawolff closed this task as Resolved.Dec 13 2017, 11:16 PM
Bawolff claimed this task.