X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiImport.php;h=f48a822e365329b22fd50f4b03fe32b47bf448c7;hb=7ab280ca486e3fef0fd1cbdbc18017d9455f04a1;hp=408805ee639d17720e1ea3eaec2b0529122a9642;hpb=4feea6a4ec1fe0a1f7a2518d89c293fdb2df5f22;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php index 408805ee63..f48a822e36 100644 --- a/includes/api/ApiImport.php +++ b/includes/api/ApiImport.php @@ -57,7 +57,7 @@ class ApiImport extends ApiBase { $source = ImportStreamSource::newFromUpload( 'xml' ); } if ( !$source->isOK() ) { - $this->dieUsageMsg( $source->getErrorsArray() ); + $this->dieStatus( $source ); } $importer = new WikiImporter( $source->value ); @@ -66,8 +66,8 @@ class ApiImport extends ApiBase { } if ( isset( $params['rootpage'] ) ) { $statusRootPage = $importer->setTargetRootPage( $params['rootpage'] ); - if( !$statusRootPage->isGood() ) { - $this->dieUsageMsg( $statusRootPage->getErrorsArray() ); + if ( !$statusRootPage->isGood() ) { + $this->dieStatus( $statusRootPage ); } } $reporter = new ApiImportReporter( @@ -105,7 +105,9 @@ class ApiImport extends ApiBase { ApiBase::PARAM_REQUIRED => true ), 'summary' => null, - 'xml' => null, + 'xml' => array( + ApiBase::PARAM_TYPE => 'upload', + ), 'interwikisource' => array( ApiBase::PARAM_TYPE => $wgImportSources ),