From: Sam Reed Date: Tue, 14 Dec 2010 21:40:14 +0000 (+0000) Subject: * (bug 26339) Throw warning when truncating an overlarge API result X-Git-Tag: 1.31.0-rc.0~33295 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=d8a241f6a7a0b70b256e0fb1b51a8ab636ad07f2;p=lhc%2Fweb%2Fwiklou.git * (bug 26339) Throw warning when truncating an overlarge API result --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1c1cfff282..a682b9d68a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -37,6 +37,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 18372) File types blacklisted by $wgFileBlacklist will no longer be shown as "Permitted file types" on the upload form === API changes in 1.18 === +* (bug 26339) Throw warning when truncating an overlarge API result === Languages updated in 1.18 === diff --git a/includes/api/ApiResult.php b/includes/api/ApiResult.php index ee1923fd89..6a37a57f52 100644 --- a/includes/api/ApiResult.php +++ b/includes/api/ApiResult.php @@ -257,6 +257,9 @@ class ApiResult extends ApiBase { if ( $this->mCheckingSize ) { $newsize = $this->mSize + self::size( $value ); if ( $newsize > $wgAPIMaxResultSize ) { + $this->setWarning( + "This result was truncated because it would otherwise be larger than the " . + "limit of {$wgAPIMaxResultSize} bytes" ); return false; } $this->mSize = $newsize;