$choices[] = $t;
}
}
- $desc .= $paramPrefix . $nothingPrompt . $prompt . implode( ', ', $choices );
+ $desc .= $paramPrefix . $nothingPrompt . $prompt;
+ $choicesstring = implode( ', ', $choices );
+ $desc .= wordwrap( $choicesstring, 100, "\n " );
} else {
switch ( $type ) {
case 'namespace':
$isArray = is_array( $paramSettings[self::PARAM_TYPE] );
if ( !$isArray
- || $isArray && count( $paramSettings[self::PARAM_TYPE] ) > self::LIMIT_SML1) {
+ || $isArray && count( $paramSettings[self::PARAM_TYPE] ) > self::LIMIT_SML1 ) {
$desc .= $paramPrefix . "Maximum number of values " .
self::LIMIT_SML1 . " (" . self::LIMIT_SML2 . " for bots)";
}
? $paramSettings[self::PARAM_RANGE_ENFORCE] : false;
if ( !is_null( $min ) || !is_null( $max ) ) {
- if ( is_array( $value ) ) {
- $value = array_map( 'intval', $value );
- foreach ( $value as &$v ) {
+ if ( is_array( $value ) ) {
+ $value = array_map( 'intval', $value );
+ foreach ( $value as &$v ) {
$this->validateLimit( $paramName, $v, $min, $max, null, $enforceLimits );
}
- } else {
- $value = intval( $value );
- $this->validateLimit( $paramName, $value, $min, $max, null, $enforceLimits );
- }
+ } else {
+ $value = intval( $value );
+ $this->validateLimit( $paramName, $value, $min, $max, null, $enforceLimits );
+ }
+ } else {
+ $value = intval( $value );
}
break;
case 'limit':
* Prints usage info on failure.
* @param $paramName string Parameter name
* @param $value int Parameter value
- * @param $min int Minimum value
- * @param $max int Maximum value for users
+ * @param $min int|null Minimum value
+ * @param $max int|null Maximum value for users
* @param $botMax int Maximum value for sysops/bots
* @param $enforceLimits Boolean Whether to enforce (die) if value is outside limits
*/
'sharedfile-exists' => array( 'code' => 'fileexists-sharedrepo-perm', 'info' => 'The target file exists on a shared repository. Use the ignorewarnings parameter to override it.' ),
'mustbeposted' => array( 'code' => 'mustbeposted', 'info' => "The \$1 module requires a POST request" ),
'show' => array( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ),
+ 'specialpage-cantexecute' => array( 'code' => 'specialpage-cantexecute', 'info' => "You don't have permission to view the results of this special page" ),
// ApiEditPage messages
'noimageredirect-anon' => array( 'code' => 'noimageredirect-anon', 'info' => "Anonymous users can't create image redirects" ),