From: Florian Date: Sat, 25 Jun 2016 16:43:23 +0000 (+0200) Subject: Expose $wgMaxArticleSize in siteinfo query api X-Git-Tag: 1.31.0-rc.0~6517^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=13155a331795eab2a50a3f92f81d4e7b53ea3760;p=lhc%2Fweb%2Fwiklou.git Expose $wgMaxArticleSize in siteinfo query api Currently, an user of the api has to try to save a page to see, if it's too big, or not. A much saner way would be, that the api user reads the siteinfo of the target wiki to know the maximum size of a page and trim the edit to not exceed this limit. This commit exposes the value of the configuration variable, which handles the maximum article size. Bug: T138669 Change-Id: I25a4c1b9013f98e5b0a263a637c8b006dccfd5ad --- diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 590a71265e..90ad584ca7 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -221,6 +221,8 @@ class ApiQuerySiteinfo extends ApiQueryBase { } $data['writeapi'] = (bool)$config->get( 'EnableWriteAPI' ); + $data['maxarticlesize'] = $config->get( 'MaxArticleSize' ) * 1024; + $tz = $config->get( 'Localtimezone' ); $offset = $config->get( 'LocalTZoffset' ); if ( is_null( $tz ) ) {