"Krinkle" posted a comment on MediaWiki.r100509. URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100509#c29695
Commit summary for MediaWiki.r100509: (bug 31414) Skin specific gadgets Krinkle's comment: Actually array_intersect isn't as much an issue as much as much as the issue is in the nature of filtering user input in a different context that it was entered by the user. So if we've got a wiki with skin <tt>foo</tt>, <tt>bar</tt> and <tt>quux</tt> and gadget X and gadget Y: <pre> *GadgetX[skin=foo]|GadgetX.js|GadgetX.js *GadgetY|GadgetY.js|GadgetY.js </pre> Then at this moment in time GadgetX is only for users with "foo" skin and GadgetY for everyone. If this gadget remains untouched and at some point skin "foo" is removed then suddently due to the above cited code (if I understand correctly) it will be evaluated as if it was the following: <pre> *GadgetX|GadgetX.js|GadgetX.js *GadgetY|GadgetY.js|GadgetY.js </pre> Eventough no change took place and GadgetX is still incompatible with other skins. So do we need to filter them at all ? Assuming the reason is validation, I think it's fine without in this case. Invalid skins simply never match anyones preference. In ResourceLoader2/Gadgets 2.0 we will do this in a "nicer" way in the front-end by limiting the users choice in the first place, but that's another story. _______________________________________________ MediaWiki-CodeReview mailing list mediawiki-coderev...@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview