* (bug 26339) Throw warning when truncating an overlarge API result
authorSam Reed <reedy@users.mediawiki.org>
Tue, 14 Dec 2010 21:40:14 +0000 (21:40 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 14 Dec 2010 21:40:14 +0000 (21:40 +0000)
RELEASE-NOTES
includes/api/ApiResult.php

index 1c1cfff..a682b9d 100644 (file)
@@ -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 ===
 
index ee1923f..6a37a57 100644 (file)
@@ -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;