Simetrical wrote:
On Tue, Mar 4, 2008 at 4:27 PM, ialex@svn.wikimedia.org wrote:
'wgRestrictionEdit' => $wgTitle->getRestrictions( 'edit' ),
'wgRestrictionMove' => $wgTitle->getRestrictions( 'move' ),
. . .
foreach( $wgRestrictionTypes as $type )
$vars['wgRestriction' . ucfirst( $type )] = $wgTitle->getRestrictions( $type );
Wouldn't this be better implemented as a client-side array, with the old two variable names kept for a while for backward compatibility? There's no guarantee that all action types will always be suitable for use in C-style variables. In principle (say for extension-generated actions) they could be arbitrary Unicode strings. It's perfectly plausible that they might contain hyphens, say, which would immediately cause a fatal error here.
Besides, generating one variable for each member of an arbitrary list is just wrong. That's what arrays are *for*.
<aol>me too!</aol>
-- brion