User "Krinkle" posted a comment on MediaWiki.r96188.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96188#c24781
Commit summary:

Expand r96170's support for space separated attributes with support for boolean 
keys such as array( 'class' => array( 'selected' => true ) ) to match our 
array( 'checked' => false ) support.
As per discussion with Krinkle make sure that in array( 'foo', 'foo' => false, 
'foo' ) the 'foo' key is authoritive.

Comment:

Per r100629 test cases, Yes that is the case.

If there is both a numeral array entry and an associative array entry, the 
latter will be the one used. If that one has a false-y value it is removed from 
the array.

This allows users to easily remove a class from the array from a hook without 
having to go array-index and find the key to unset it (not to mention cases 
where the to-be-removed key can be part of another string).

<pre>
array( 'class' => array( 
  'foo baz quux',
  'baz' => true,
  'quux' => false,
 ) );

# class="foo baz"
></pre>

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to