if ( is_array( $type ) ) {
$choices = array();
$nothingPrompt = false;
- foreach ( $type as $t )
+ foreach ( $type as $t ) {
if ( $t === '' ) {
$nothingPrompt = 'Can be empty, or ';
} else {
$choices[] = $t;
}
+ }
$desc .= $paramPrefix . $nothingPrompt . $prompt . implode( ', ', $choices );
} else {
switch ( $type ) {
$value = wfTimestamp( TS_MW, $value );
break;
case 'user':
- if ( !is_array( $value ) ) $value = array( $value );
-
+ if ( !is_array( $value ) ) {
+ $value = array( $value );
+ }
+
foreach ( $value as $key => $val ) {
$title = Title::makeTitleSafe( NS_USER, $val );
if ( is_null( $title ) ) {
$value[$key] = $title->getText();
}
- if ( !$multi ) $value = $value[0];
-
- break;
+ if ( !$multi ) {
+ $value = $value[0];
+ }
+ break;
default:
ApiBase::dieDebug( __METHOD__, "Param $encParamName's type is unknown - $type" );
}
'userrights-nodatabase' => array( 'code' => 'nosuchdatabase', 'info' => "Database ``\$1'' does not exist or is not local" ),
'nouserspecified' => array( 'code' => 'invaliduser', 'info' => "Invalid username ``\$1''" ),
'noname' => array( 'code' => 'invaliduser', 'info' => "Invalid username ``\$1''" ),
- 'summaryrequired' => array( 'code' => 'summaryrequired', 'info' => 'Summary required'),
+ 'summaryrequired' => array( 'code' => 'summaryrequired', 'info' => 'Summary required' ),
// API-specific messages
'readrequired' => array( 'code' => 'readapidenied', 'info' => "You need read permission to use this module" ),