Wikimedia

MobileFormatter: Do not scrub elements on pages in template namespace

This task is about the MobileFrontend extension of MediaWiki.

Scrubbing elements on template pages MobileFormatter::filterContent can cause confusion to editors. For example https://hu.m.wikipedia.org/wiki/Sablon:%C3%9Ajpest_FC_keret which features a navbox and no other HTML shows as an empty page!

What you have to do:

Do not apply the MobileFormatter transformation to content in the template namespace. To do this we will update the logic in the hook that transforms the content. The new logic should be configurable so we can exclude other namespaces in future. We'll add a config variable called wgMFMobileFormatterNamespaceBlacklist which should default to [ NS_TEMPLATE, NS_SPECIAL ]. This will allow us to add other namespaces easily if necessary.

For extra points and kudos the isSpecialPage checks inside https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/includes/MobileFormatter.php#L180 should be no longer necessary as a result of this change. Please remove this code in a separate follow up to your change. Good work!

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

pppery

Task type

  • code Code
close

2017