From: Sam Reed Date: Sun, 13 Feb 2011 17:00:47 +0000 (+0000) Subject: * (bug 27376) when using ApiBase::PARAM_TYPE => 'integer' without a min or max value... X-Git-Tag: 1.31.0-rc.0~32010 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=3721e827ac6102a2d9e801de17bc89355692be52;p=lhc%2Fweb%2Fwiklou.git * (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 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 600dd6aaf1..1e5d4746fa 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -169,6 +169,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Add a amtitle param to meta=allmessages * (bug 25832) query=allimages now outputs ns/title as well * (bug 27199) Thumbnail urls can be fetched for old files as well +* (bug 27376) when using ApiBase::PARAM_TYPE => 'integer' without a min or + max value, api doesn't validate the input is actually an integer === Languages updated in 1.18 === diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 7775c7d068..babaf7844c 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -707,15 +707,17 @@ abstract class ApiBase { ? $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':