Documentation in ApiDelete
break;
case 'integer': // Force everything using intval() and optionally validate limits
break;
case 'integer': // Force everything using intval() and optionally validate limits
- $value = is_array( $value ) ? array_map( 'intval', $value ) : intval( $value );
-
$min = isset ( $paramSettings[self::PARAM_MIN] ) ? $paramSettings[self::PARAM_MIN] : null;
$max = isset ( $paramSettings[self::PARAM_MAX] ) ? $paramSettings[self::PARAM_MAX] : null;
$enforceLimits = isset ( $paramSettings[self::PARAM_RANGE_ENFORCE] )
$min = isset ( $paramSettings[self::PARAM_MIN] ) ? $paramSettings[self::PARAM_MIN] : null;
$max = isset ( $paramSettings[self::PARAM_MAX] ) ? $paramSettings[self::PARAM_MAX] : null;
$enforceLimits = isset ( $paramSettings[self::PARAM_RANGE_ENFORCE] )
if ( !is_null( $min ) || !is_null( $max ) ) {
if ( is_array( $value ) ) {
if ( !is_null( $min ) || !is_null( $max ) ) {
if ( is_array( $value ) ) {
+ $value = array_map( 'intval', $value );
foreach ( $value as &$v ) {
foreach ( $value as &$v ) {
- $this->validateLimit( $paramName, $v, $min, $max, $enforceLimits );
+ $this->validateLimit( $paramName, $v, $min, $max, null, $enforceLimits );
- $this->validateLimit( $paramName, $value, $min, $max, $enforceLimits );
+ $value = intval( $value );
+ $this->validateLimit( $paramName, $value, $min, $max, null, $enforceLimits );
*/
private function warnOrDie( $msg, $enforceLimits = false ) {
if ( $enforceLimits ) {
*/
private function warnOrDie( $msg, $enforceLimits = false ) {
if ( $enforceLimits ) {
- $this->dieUsageMsg( $msg );
+ $this->dieUsage( 'integeroutofrange', $msg );
} else {
$this->setWarning( $msg );
}
} else {
$this->setWarning( $msg );
}
$this->getResult()->addValue( null, $this->getModuleName(), $r );
}
$this->getResult()->addValue( null, $this->getModuleName(), $r );
}
+ /**
+ *
+ * @param &$title Title
+ * @param $token String
+ */
private static function getPermissionsError( &$title, $token ) {
global $wgUser;
private static function getPermissionsError( &$title, $token ) {
global $wgUser;