r109290 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109289‎ | r109290 | r109291 >
Date:02:44, 18 January 2012
Author:liangent
Status:ok
Tags:miscextensions 
Comment:
Followup r100509: Don't validate skin names written in the definition page.
Modified paths:
  • /trunk/extensions/Gadgets/Gadgets_body.php (modified) (history)
  • /trunk/extensions/Gadgets/SpecialGadgets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Gadgets/Gadgets_body.php
@@ -307,7 +307,7 @@
308308 $gadget->requiredRights = $params;
309309 break;
310310 case 'skins':
311 - $gadget->requiredSkins = array_intersect( array_keys( Skin::getSkinNames() ), $params );
 311+ $gadget->requiredSkins = $params;
312312 break;
313313 case 'default':
314314 $gadget->onByDefault = true;
Index: trunk/extensions/Gadgets/SpecialGadgets.php
@@ -129,8 +129,13 @@
130130 }
131131
132132 $skins = array();
 133+ $validskins = Skin::getSkinNames();
133134 foreach ( $gadget->getRequiredSkins() as $skinid ) {
134 - $skins[] = wfMessage( "skinname-$skinid" )->plain();
 135+ if ( isset( $validskins[$skinid] ) ) {
 136+ $skins[] = wfMessage( "skinname-$skinid" )->plain();
 137+ } else {
 138+ $skins[] = $skinid;
 139+ }
135140 }
136141 if ( count( $skins ) ) {
137142 $wgOut->addHTML( '<br />' .

Sign-offs

UserFlagDate
Krinkleinspected23:12, 23 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100509(bug 31414) Skin specific gadgetsliangent19:09, 22 October 2011

Status & tagging log