[MediaWiki-commits] [Gerrit] Expose $wgMaxArticleSize in siteinfo query api - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Expose $wgMaxArticleSize in siteinfo query api .. 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 --- M includes/api/ApiQuerySiteinfo.php 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Anomie: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 590a712..90ad584 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -221,6 +221,8 @@ } $data['writeapi'] = (bool)$config->get( 'EnableWriteAPI' ); + $data['maxarticlesize'] = $config->get( 'MaxArticleSize' ) * 1024; + $tz = $config->get( 'Localtimezone' ); $offset = $config->get( 'LocalTZoffset' ); if ( is_null( $tz ) ) { -- To view, visit https://gerrit.wikimedia.org/r/296062 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I25a4c1b9013f98e5b0a263a637c8b006dccfd5ad Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: FlorianschmidtwelzowGerrit-Reviewer: Addshore Gerrit-Reviewer: Anomie Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: TTO Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Expose $wgMaxArticleSize in siteinfo query api - change (mediawiki/core)
Florianschmidtwelzow has uploaded a new change for review. https://gerrit.wikimedia.org/r/296062 Change subject: Expose $wgMaxArticleSize in siteinfo query api .. 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 --- M includes/api/ApiQuerySiteinfo.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/62/296062/1 diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 590a712..14355b6 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -221,6 +221,8 @@ } $data['writeapi'] = (bool)$config->get( 'EnableWriteAPI' ); + $data['maxarticlesize'] = $config->get( 'MaxArticleSize' ); + $tz = $config->get( 'Localtimezone' ); $offset = $config->get( 'LocalTZoffset' ); if ( is_null( $tz ) ) { -- To view, visit https://gerrit.wikimedia.org/r/296062 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I25a4c1b9013f98e5b0a263a637c8b006dccfd5ad Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits