Wikimedia

In MediaWiki core or extensions, replace wfMessage()->rawParams() with wfMessage()->plaintextParams() where applicable

Message::rawParams tells the MediaWiki internationalization (i18n) functions to insert the parameter to a message raw - i.e. with no escaping or processing. Since this disables escaping, any usage of rawParams requires careful review. Prior to the introduction of ->plaintextParams(), people sometimes used ->rawParams() where they wanted to stop text processing (e.g. replacing the magic word {{SITENAME}} with the name of the site) but did not need to stop escaping.

Now that we have ->plaintextParams(), we should use it for any of the cases where we need to stop text processing but still want escaping.

One can often identify such cases, as they usually use the ->text() message format.

The task is to find one instance of wfMessage() (Or more generally, any usage of the i18n system) where ->rawParams can be replaced with ->plaintextParams() without causing any behaviour changes.

Important: Some usages of ->rawParams() ARE needed. So you'll only finish this task when replacing a usage where the no-escaping behaviour of rawParams() is not needed.

You can replace any case that is not using the ->parse(), ->parseAsBlock() or ->escaped() message formats. See the Phabricator task for an example.

This task applies to both MediaWiki core, as well as any extension in Wikimedia Git?Gerrit. To complete this task, you only have to fix one instance.

You are expected to provide a patch in Wikimedia Gerrit. See https://www.mediawiki.org/wiki/Gerrit/Tutorial for how to set up Git and Gerrit.

Task tags

  • php

Students who completed this task

JeremyNguyen

Task type

  • code Code
close

2019