summaryrefslogtreecommitdiff
path: root/includes/api/ApiImport.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiImport.php')
-rw-r--r--includes/api/ApiImport.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php
index 2e87d22d..735cc7fa 100644
--- a/includes/api/ApiImport.php
+++ b/includes/api/ApiImport.php
@@ -32,9 +32,13 @@
class ApiImport extends ApiBase {
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$user = $this->getUser();
$params = $this->extractRequestParams();
+ $this->requireMaxOneParameter( $params, 'namespace', 'rootpage' );
+
$isUpload = false;
if ( isset( $params['interwikisource'] ) ) {
if ( !$user->isAllowed( 'import' ) ) {
@@ -63,8 +67,7 @@ class ApiImport extends ApiBase {
$importer = new WikiImporter( $source->value, $this->getConfig() );
if ( isset( $params['namespace'] ) ) {
$importer->setTargetNamespace( $params['namespace'] );
- }
- if ( isset( $params['rootpage'] ) ) {
+ } elseif ( isset( $params['rootpage'] ) ) {
$statusRootPage = $importer->setTargetRootPage( $params['rootpage'] );
if ( !$statusRootPage->isGood() ) {
$this->dieStatus( $statusRootPage );