r82060 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82059‎ | r82060 | r82061 >
Date:17:00, 13 February 2011
Author:reedy
Status:resolved
Tags:
Comment:
* (bug 27376) when using ApiBase::PARAM_TYPE => 'integer' without a min or max value, api doesn't validate the input is actually an integer

Fixup some space indention
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiBase.php
@@ -707,15 +707,17 @@
708708 ? $paramSettings[self::PARAM_RANGE_ENFORCE] : false;
709709
710710 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 ) {
714714 $this->validateLimit( $paramName, $v, $min, $max, null, $enforceLimits );
715715 }
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 );
720722 }
721723 break;
722724 case 'limit':
Index: trunk/phase3/RELEASE-NOTES
@@ -169,6 +169,8 @@
170170 * Add a amtitle param to meta=allmessages
171171 * (bug 25832) query=allimages now outputs ns/title as well
172172 * (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
173175
174176 === Languages updated in 1.18 ===
175177

Follow-up revisions

RevisionCommit summaryAuthorDate
r83178Followup r82060...reedy23:22, 3 March 2011

Status & tagging log