r94784 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94783‎ | r94784 | r94785 >
Date:17:55, 17 August 2011
Author:demon
Status:ok (Comments)
Tags:
Comment:
Make removed classes configurable. In the amount of time people have been complaining on IRC, 5 different people could've fixed this.
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -48,6 +48,12 @@
4949
5050 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' );
5151
 52+/**
 53+ * Make the classes stripped from page content configurable. Each item will
 54+ * be stripped from the page. See $itemsToRemove for more info
 55+ */
 56+$wgMFRemovableClasses = array();
 57+
5258 class ExtMobileFrontend {
5359 const VERSION = '0.5.32';
5460
@@ -536,9 +542,12 @@
537543 }
538544
539545 private function parseItemsToRemove() {
 546+ global $wgMFRemovableClasses;
540547 $itemToRemoveRecords = array();
541548
542 - foreach ( $this->itemsToRemove as $itemToRemove ) {
 549+ foreach ( array_merge( $this->itemsToRemove, $wgMFRemovableClasses )
 550+ as $itemToRemove )
 551+ {
543552 $type = '';
544553 $rawName = '';
545554 CssDetection::detectIdCssOrTag( $itemToRemove, $type, $rawName );

Comments

#Comment by MZMcBride (talk | contribs)   20:06, 17 August 2011

Related to bug 30421 and r94779, for reference.

As I said in bugzilla:30421#c6, I think this revision is an improvement, but I don't think it's a very good solution overall.

Status & tagging log