X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQuery.php;h=bdb0dc22aa31234c6f052253d2587d7ce3b8782d;hb=cca344a717b9e41b0e32e4915295cd36dd18bf83;hp=ae6b1a1dbca00b007d06ed60fa8a02514a4bc152;hpb=243a466018d24415de27815cfae995865c45a66a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index ae6b1a1dbc..bdb0dc22aa 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -115,6 +115,7 @@ class ApiQuery extends ApiBase { 'userinfo' => ApiQueryUserInfo::class, 'filerepoinfo' => ApiQueryFileRepoInfo::class, 'tokens' => ApiQueryTokens::class, + 'languageinfo' => ApiQueryLanguageinfo::class, ]; /** @@ -429,10 +430,9 @@ class ApiQuery extends ApiBase { $exportTitles = []; $titles = $pageSet->getGoodTitles(); if ( count( $titles ) ) { - $user = $this->getUser(); /** @var Title $title */ foreach ( $titles as $title ) { - if ( $title->userCan( 'read', $user ) ) { + if ( $this->getPermissionManager()->userCan( 'read', $this->getUser(), $title ) ) { $exportTitles[] = $title; } } @@ -441,6 +441,7 @@ class ApiQuery extends ApiBase { $exporter = new WikiExporter( $this->getDB() ); $sink = new DumpStringOutput; $exporter->setOutputSink( $sink ); + $exporter->setSchemaVersion( $this->mParams['exportschema'] ); $exporter->openStream(); foreach ( $exportTitles as $title ) { $exporter->pageByTitle( $title ); @@ -479,6 +480,10 @@ class ApiQuery extends ApiBase { 'indexpageids' => false, 'export' => false, 'exportnowrap' => false, + 'exportschema' => [ + ApiBase::PARAM_DFLT => WikiExporter::schemaVersion(), + ApiBase::PARAM_TYPE => XmlDumpWriter::$supportedSchemas, + ], 'iwurl' => false, 'continue' => [ ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',