jenkins-bot has submitted this change and it was merged.

Change subject: API Import: Die when namespace and rootpage is set
......................................................................


API Import: Die when namespace and rootpage is set

With I11521260a88a7f4a95fbdb71ac50bcf7b4fe5cd1 the rootpage parameter
gets ignored when namespace parameter is set.
This can break the behaviour for the client. Just break the client by
returning an error instead of silent ignoring a parameter.

Change-Id: Ie1c7447b5d59ff4d3466b504d5d1afc0d296841a
---
M includes/api/ApiImport.php
M includes/api/i18n/en.json
2 files changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  TTO: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php
index 40cf6e2..4154083 100644
--- a/includes/api/ApiImport.php
+++ b/includes/api/ApiImport.php
@@ -35,6 +35,8 @@
                $user = $this->getUser();
                $params = $this->extractRequestParams();
 
+               $this->requireMaxOneParameter( $params, 'namespace', 'rootpage' 
);
+
                $isUpload = false;
                if ( isset( $params['interwikisource'] ) ) {
                        if ( !$user->isAllowed( 'import' ) ) {
diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json
index 3c53be1..bece0b2 100644
--- a/includes/api/i18n/en.json
+++ b/includes/api/i18n/en.json
@@ -196,8 +196,8 @@
        "apihelp-import-param-interwikipage": "For interwiki imports: page to 
import.",
        "apihelp-import-param-fullhistory": "For interwiki imports: import the 
full history, not just the current version.",
        "apihelp-import-param-templates": "For interwiki imports: import all 
included templates as well.",
-       "apihelp-import-param-namespace": "Import to this namespace. Overrides 
the <kbd>$1rootpage</kbd> parameter.",
-       "apihelp-import-param-rootpage": "Import as subpage of this page. 
Ignored if the <kbd>$1namespace</kbd> parameter is provided.",
+       "apihelp-import-param-namespace": "Import to this namespace. Cannot be 
used together with <var>$1rootpage</var>.",
+       "apihelp-import-param-rootpage": "Import as subpage of this page. 
Cannot be used together with <var>$1namespace</var>.",
        "apihelp-import-example-import": "Import [[meta:Help:Parserfunctions]] 
to namespace 100 with full history.",
 
        "apihelp-login-description": "Log in and get authentication 
cookies.\n\nIn the event of a successful log-in, the needed cookies will be 
included in the HTTP response headers. In the event of a failed log-in, further 
attempts may be throttled to limit automated password guessing attacks.",

-- 
To view, visit https://gerrit.wikimedia.org/r/210945
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie1c7447b5d59ff4d3466b504d5d1afc0d296841a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: TTO <at.li...@live.com.au>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to