From d8a241f6a7a0b70b256e0fb1b51a8ab636ad07f2 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 14 Dec 2010 21:40:14 +0000 Subject: [PATCH] * (bug 26339) Throw warning when truncating an overlarge API result --- RELEASE-NOTES | 1 + includes/api/ApiResult.php | 3 +++ 2 files changed, 4 insertions(+) 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; -- 2.20.1