Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -707,15 +707,17 @@ |
708 | 708 | ? $paramSettings[self::PARAM_RANGE_ENFORCE] : false; |
709 | 709 | |
710 | 710 | if ( !is_null( $min ) || !is_null( $max ) ) { |
711 | | - if ( is_array( $value ) ) { |
712 | | - $value = array_map( 'intval', $value ); |
713 | | - foreach ( $value as &$v ) { |
| 711 | + if ( is_array( $value ) ) { |
| 712 | + $value = array_map( 'intval', $value ); |
| 713 | + foreach ( $value as &$v ) { |
714 | 714 | $this->validateLimit( $paramName, $v, $min, $max, null, $enforceLimits ); |
715 | 715 | } |
716 | | - } else { |
717 | | - $value = intval( $value ); |
718 | | - $this->validateLimit( $paramName, $value, $min, $max, null, $enforceLimits ); |
719 | | - } |
| 716 | + } else { |
| 717 | + $value = intval( $value ); |
| 718 | + $this->validateLimit( $paramName, $value, $min, $max, null, $enforceLimits ); |
| 719 | + } |
| 720 | + } else { |
| 721 | + $value = intval( $value ); |
720 | 722 | } |
721 | 723 | break; |
722 | 724 | case 'limit': |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -169,6 +169,8 @@ |
170 | 170 | * Add a amtitle param to meta=allmessages |
171 | 171 | * (bug 25832) query=allimages now outputs ns/title as well |
172 | 172 | * (bug 27199) Thumbnail urls can be fetched for old files as well |
| 173 | +* (bug 27376) when using ApiBase::PARAM_TYPE => 'integer' without a min or |
| 174 | + max value, api doesn't validate the input is actually an integer |
173 | 175 | |
174 | 176 | === Languages updated in 1.18 === |
175 | 177 | |