Index: trunk/phase3/includes/api/ApiDelete.php |
— | — | @@ -97,6 +97,11 @@ |
98 | 98 | $this->getResult()->addValue( null, $this->getModuleName(), $r ); |
99 | 99 | } |
100 | 100 | |
| 101 | + /** |
| 102 | + * |
| 103 | + * @param &$title Title |
| 104 | + * @param $token String |
| 105 | + */ |
101 | 106 | private static function getPermissionsError( &$title, $token ) { |
102 | 107 | global $wgUser; |
103 | 108 | |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -677,8 +677,6 @@ |
678 | 678 | |
679 | 679 | break; |
680 | 680 | case 'integer': // Force everything using intval() and optionally validate limits |
681 | | - $value = is_array( $value ) ? array_map( 'intval', $value ) : intval( $value ); |
682 | | - |
683 | 681 | $min = isset ( $paramSettings[self::PARAM_MIN] ) ? $paramSettings[self::PARAM_MIN] : null; |
684 | 682 | $max = isset ( $paramSettings[self::PARAM_MAX] ) ? $paramSettings[self::PARAM_MAX] : null; |
685 | 683 | $enforceLimits = isset ( $paramSettings[self::PARAM_RANGE_ENFORCE] ) |
— | — | @@ -686,11 +684,13 @@ |
687 | 685 | |
688 | 686 | if ( !is_null( $min ) || !is_null( $max ) ) { |
689 | 687 | if ( is_array( $value ) ) { |
| 688 | + $value = array_map( 'intval', $value ); |
690 | 689 | foreach ( $value as &$v ) { |
691 | | - $this->validateLimit( $paramName, $v, $min, $max, $enforceLimits ); |
| 690 | + $this->validateLimit( $paramName, $v, $min, $max, null, $enforceLimits ); |
692 | 691 | } |
693 | 692 | } else { |
694 | | - $this->validateLimit( $paramName, $value, $min, $max, $enforceLimits ); |
| 693 | + $value = intval( $value ); |
| 694 | + $this->validateLimit( $paramName, $value, $min, $max, null, $enforceLimits ); |
695 | 695 | } |
696 | 696 | } |
697 | 697 | break; |
— | — | @@ -866,7 +866,7 @@ |
867 | 867 | */ |
868 | 868 | private function warnOrDie( $msg, $enforceLimits = false ) { |
869 | 869 | if ( $enforceLimits ) { |
870 | | - $this->dieUsageMsg( $msg ); |
| 870 | + $this->dieUsage( 'integeroutofrange', $msg ); |
871 | 871 | } else { |
872 | 872 | $this->setWarning( $msg ); |
873 | 873 | } |