Merge "Rename autonym for 'no' from 'norsk bokmål' to 'norsk'"
[lhc/web/wiklou.git] / includes / specials / SpecialImport.php
1 <?php
2 /**
3 * Implements Special:Import
4 *
5 * Copyright © 2003,2005 Brion Vibber <brion@pobox.com>
6 * https://www.mediawiki.org/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * http://www.gnu.org/copyleft/gpl.html
22 *
23 * @file
24 * @ingroup SpecialPage
25 */
26
27 use MediaWiki\MediaWikiServices;
28
29 /**
30 * MediaWiki page data importer
31 *
32 * @ingroup SpecialPage
33 */
34 class SpecialImport extends SpecialPage {
35 private $sourceName = false;
36 private $interwiki = false;
37 private $subproject;
38 private $fullInterwikiPrefix;
39 private $mapping = 'default';
40 private $namespace;
41 private $rootpage = '';
42 private $frompage = '';
43 private $logcomment = false;
44 private $history = true;
45 private $includeTemplates = false;
46 private $pageLinkDepth;
47 private $importSources;
48
49 public function __construct() {
50 parent::__construct( 'Import', 'import' );
51 }
52
53 public function doesWrites() {
54 return true;
55 }
56
57 /**
58 * Execute
59 * @param string|null $par
60 * @throws PermissionsError
61 * @throws ReadOnlyError
62 */
63 function execute( $par ) {
64 $this->useTransactionalTimeLimit();
65
66 $this->setHeaders();
67 $this->outputHeader();
68
69 $this->namespace = $this->getConfig()->get( 'ImportTargetNamespace' );
70
71 $this->getOutput()->addModules( 'mediawiki.special.import' );
72
73 $this->importSources = $this->getConfig()->get( 'ImportSources' );
74 Hooks::run( 'ImportSources', [ &$this->importSources ] );
75
76 $user = $this->getUser();
77 if ( !$user->isAllowedAny( 'import', 'importupload' ) ) {
78 throw new PermissionsError( 'import' );
79 }
80
81 # @todo Allow Title::getUserPermissionsErrors() to take an array
82 # @todo FIXME: Title::checkSpecialsAndNSPermissions() has a very wierd expectation of what
83 # getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected'
84 $errors = wfMergeErrorArrays(
85 $this->getPageTitle()->getUserPermissionsErrors(
86 'import', $user, true,
87 [ 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ]
88 ),
89 $this->getPageTitle()->getUserPermissionsErrors(
90 'importupload', $user, true,
91 [ 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ]
92 )
93 );
94
95 if ( $errors ) {
96 throw new PermissionsError( 'import', $errors );
97 }
98
99 $this->checkReadOnly();
100
101 $request = $this->getRequest();
102 if ( $request->wasPosted() && $request->getVal( 'action' ) == 'submit' ) {
103 $this->doImport();
104 }
105 $this->showForm();
106 }
107
108 /**
109 * Do the actual import
110 */
111 private function doImport() {
112 $isUpload = false;
113 $request = $this->getRequest();
114 $this->sourceName = $request->getVal( "source" );
115
116 $this->logcomment = $request->getText( 'log-comment' );
117 $this->pageLinkDepth = $this->getConfig()->get( 'ExportMaxLinkDepth' ) == 0
118 ? 0
119 : $request->getIntOrNull( 'pagelink-depth' );
120
121 $this->mapping = $request->getVal( 'mapping' );
122 if ( $this->mapping === 'namespace' ) {
123 $this->namespace = $request->getIntOrNull( 'namespace' );
124 } elseif ( $this->mapping === 'subpage' ) {
125 $this->rootpage = $request->getText( 'rootpage' );
126 } else {
127 $this->mapping = 'default';
128 }
129
130 $user = $this->getUser();
131 if ( !$user->matchEditToken( $request->getVal( 'editToken' ) ) ) {
132 $source = Status::newFatal( 'import-token-mismatch' );
133 } elseif ( $this->sourceName === 'upload' ) {
134 $isUpload = true;
135 if ( $user->isAllowed( 'importupload' ) ) {
136 $source = ImportStreamSource::newFromUpload( "xmlimport" );
137 } else {
138 throw new PermissionsError( 'importupload' );
139 }
140 } elseif ( $this->sourceName === 'interwiki' ) {
141 if ( !$user->isAllowed( 'import' ) ) {
142 throw new PermissionsError( 'import' );
143 }
144 $this->interwiki = $this->fullInterwikiPrefix = $request->getVal( 'interwiki' );
145 // does this interwiki have subprojects?
146 $hasSubprojects = array_key_exists( $this->interwiki, $this->importSources );
147 if ( !$hasSubprojects && !in_array( $this->interwiki, $this->importSources ) ) {
148 $source = Status::newFatal( "import-invalid-interwiki" );
149 } else {
150 if ( $hasSubprojects ) {
151 $this->subproject = $request->getVal( 'subproject' );
152 $this->fullInterwikiPrefix .= ':' . $request->getVal( 'subproject' );
153 }
154 if ( $hasSubprojects &&
155 !in_array( $this->subproject, $this->importSources[$this->interwiki] )
156 ) {
157 $source = Status::newFatal( "import-invalid-interwiki" );
158 } else {
159 $this->history = $request->getCheck( 'interwikiHistory' );
160 $this->frompage = $request->getText( "frompage" );
161 $this->includeTemplates = $request->getCheck( 'interwikiTemplates' );
162 $source = ImportStreamSource::newFromInterwiki(
163 $this->fullInterwikiPrefix,
164 $this->frompage,
165 $this->history,
166 $this->includeTemplates,
167 $this->pageLinkDepth );
168 }
169 }
170 } else {
171 $source = Status::newFatal( "importunknownsource" );
172 }
173
174 $out = $this->getOutput();
175 if ( !$source->isGood() ) {
176 $out->addWikiText( "<p class=\"error\">\n" .
177 $this->msg( 'importfailed', $source->getWikiText() )->parse() . "\n</p>" );
178 } else {
179 $importer = new WikiImporter( $source->value, $this->getConfig() );
180 if ( !is_null( $this->namespace ) ) {
181 $importer->setTargetNamespace( $this->namespace );
182 } elseif ( !is_null( $this->rootpage ) ) {
183 $statusRootPage = $importer->setTargetRootPage( $this->rootpage );
184 if ( !$statusRootPage->isGood() ) {
185 $out->wrapWikiMsg(
186 "<p class=\"error\">\n$1\n</p>",
187 [
188 'import-options-wrong',
189 $statusRootPage->getWikiText(),
190 count( $statusRootPage->getErrorsArray() )
191 ]
192 );
193
194 return;
195 }
196 }
197
198 $out->addWikiMsg( "importstart" );
199
200 $reporter = new ImportReporter(
201 $importer,
202 $isUpload,
203 $this->fullInterwikiPrefix,
204 $this->logcomment
205 );
206 $reporter->setContext( $this->getContext() );
207 $exception = false;
208
209 $reporter->open();
210 try {
211 $importer->doImport();
212 } catch ( Exception $e ) {
213 $exception = $e;
214 }
215 $result = $reporter->close();
216
217 if ( $exception ) {
218 # No source or XML parse error
219 $out->wrapWikiMsg(
220 "<p class=\"error\">\n$1\n</p>",
221 [ 'importfailed', $exception->getMessage() ]
222 );
223 } elseif ( !$result->isGood() ) {
224 # Zero revisions
225 $out->wrapWikiMsg(
226 "<p class=\"error\">\n$1\n</p>",
227 [ 'importfailed', $result->getWikiText() ]
228 );
229 } else {
230 # Success!
231 $out->addWikiMsg( 'importsuccess' );
232 }
233 $out->addHTML( '<hr />' );
234 }
235 }
236
237 private function getMappingFormPart( $sourceName ) {
238 $isSameSourceAsBefore = ( $this->sourceName === $sourceName );
239 $defaultNamespace = $this->getConfig()->get( 'ImportTargetNamespace' );
240 return "<tr>
241 <td>
242 </td>
243 <td class='mw-input'>" .
244 Xml::radioLabel(
245 $this->msg( 'import-mapping-default' )->text(),
246 'mapping',
247 'default',
248 // mw-import-mapping-interwiki-default, mw-import-mapping-upload-default
249 "mw-import-mapping-$sourceName-default",
250 ( $isSameSourceAsBefore ?
251 ( $this->mapping === 'default' ) :
252 is_null( $defaultNamespace ) )
253 ) .
254 "</td>
255 </tr>
256 <tr>
257 <td>
258 </td>
259 <td class='mw-input'>" .
260 Xml::radioLabel(
261 $this->msg( 'import-mapping-namespace' )->text(),
262 'mapping',
263 'namespace',
264 // mw-import-mapping-interwiki-namespace, mw-import-mapping-upload-namespace
265 "mw-import-mapping-$sourceName-namespace",
266 ( $isSameSourceAsBefore ?
267 ( $this->mapping === 'namespace' ) :
268 !is_null( $defaultNamespace ) )
269 ) . ' ' .
270 Html::namespaceSelector(
271 [
272 'selected' => ( $isSameSourceAsBefore ?
273 $this->namespace :
274 ( $defaultNamespace || '' ) ),
275 ], [
276 'name' => "namespace",
277 // mw-import-namespace-interwiki, mw-import-namespace-upload
278 'id' => "mw-import-namespace-$sourceName",
279 'class' => 'namespaceselector',
280 ]
281 ) .
282 "</td>
283 </tr>
284 <tr>
285 <td>
286 </td>
287 <td class='mw-input'>" .
288 Xml::radioLabel(
289 $this->msg( 'import-mapping-subpage' )->text(),
290 'mapping',
291 'subpage',
292 // mw-import-mapping-interwiki-subpage, mw-import-mapping-upload-subpage
293 "mw-import-mapping-$sourceName-subpage",
294 ( $isSameSourceAsBefore ? ( $this->mapping === 'subpage' ) : '' )
295 ) . ' ' .
296 Xml::input( 'rootpage', 50,
297 ( $isSameSourceAsBefore ? $this->rootpage : '' ),
298 [
299 // Should be "mw-import-rootpage-...", but we keep this inaccurate
300 // ID for legacy reasons
301 // mw-interwiki-rootpage-interwiki, mw-interwiki-rootpage-upload
302 'id' => "mw-interwiki-rootpage-$sourceName",
303 'type' => 'text'
304 ]
305 ) . ' ' .
306 "</td>
307 </tr>";
308 }
309
310 private function showForm() {
311 $action = $this->getPageTitle()->getLocalURL( [ 'action' => 'submit' ] );
312 $user = $this->getUser();
313 $out = $this->getOutput();
314 $this->addHelpLink( '//meta.wikimedia.org/wiki/Special:MyLanguage/Help:Import', true );
315
316 if ( $user->isAllowed( 'importupload' ) ) {
317 $mappingSelection = $this->getMappingFormPart( 'upload' );
318 $out->addHTML(
319 Xml::fieldset( $this->msg( 'import-upload' )->text() ) .
320 Xml::openElement(
321 'form',
322 [
323 'enctype' => 'multipart/form-data',
324 'method' => 'post',
325 'action' => $action,
326 'id' => 'mw-import-upload-form'
327 ]
328 ) .
329 $this->msg( 'importtext' )->parseAsBlock() .
330 Html::hidden( 'action', 'submit' ) .
331 Html::hidden( 'source', 'upload' ) .
332 Xml::openElement( 'table', [ 'id' => 'mw-import-table-upload' ] ) .
333 "<tr>
334 <td class='mw-label'>" .
335 Xml::label( $this->msg( 'import-upload-filename' )->text(), 'xmlimport' ) .
336 "</td>
337 <td class='mw-input'>" .
338 Html::input( 'xmlimport', '', 'file', [ 'id' => 'xmlimport' ] ) . ' ' .
339 "</td>
340 </tr>
341 <tr>
342 <td class='mw-label'>" .
343 Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) .
344 "</td>
345 <td class='mw-input'>" .
346 Xml::input( 'log-comment', 50,
347 ( $this->sourceName === 'upload' ? $this->logcomment : '' ),
348 [ 'id' => 'mw-import-comment', 'type' => 'text' ] ) . ' ' .
349 "</td>
350 </tr>
351 $mappingSelection
352 <tr>
353 <td></td>
354 <td class='mw-submit'>" .
355 Xml::submitButton( $this->msg( 'uploadbtn' )->text() ) .
356 "</td>
357 </tr>" .
358 Xml::closeElement( 'table' ) .
359 Html::hidden( 'editToken', $user->getEditToken() ) .
360 Xml::closeElement( 'form' ) .
361 Xml::closeElement( 'fieldset' )
362 );
363 } else {
364 if ( empty( $this->importSources ) ) {
365 $out->addWikiMsg( 'importnosources' );
366 }
367 }
368
369 if ( $user->isAllowed( 'import' ) && !empty( $this->importSources ) ) {
370 # Show input field for import depth only if $wgExportMaxLinkDepth > 0
371 $importDepth = '';
372 if ( $this->getConfig()->get( 'ExportMaxLinkDepth' ) > 0 ) {
373 $importDepth = "<tr>
374 <td class='mw-label'>" .
375 $this->msg( 'export-pagelinks' )->parse() .
376 "</td>
377 <td class='mw-input'>" .
378 Xml::input( 'pagelink-depth', 3, 0 ) .
379 "</td>
380 </tr>";
381 }
382 $mappingSelection = $this->getMappingFormPart( 'interwiki' );
383
384 $out->addHTML(
385 Xml::fieldset( $this->msg( 'importinterwiki' )->text() ) .
386 Xml::openElement(
387 'form',
388 [
389 'method' => 'post',
390 'action' => $action,
391 'id' => 'mw-import-interwiki-form'
392 ]
393 ) .
394 $this->msg( 'import-interwiki-text' )->parseAsBlock() .
395 Html::hidden( 'action', 'submit' ) .
396 Html::hidden( 'source', 'interwiki' ) .
397 Html::hidden( 'editToken', $user->getEditToken() ) .
398 Xml::openElement( 'table', [ 'id' => 'mw-import-table-interwiki' ] ) .
399 "<tr>
400 <td class='mw-label'>" .
401 Xml::label( $this->msg( 'import-interwiki-sourcewiki' )->text(), 'interwiki' ) .
402 "</td>
403 <td class='mw-input'>" .
404 Xml::openElement(
405 'select',
406 [ 'name' => 'interwiki', 'id' => 'interwiki' ]
407 )
408 );
409
410 $needSubprojectField = false;
411 foreach ( $this->importSources as $key => $value ) {
412 if ( is_int( $key ) ) {
413 $key = $value;
414 } elseif ( $value !== $key ) {
415 $needSubprojectField = true;
416 }
417
418 $attribs = [
419 'value' => $key,
420 ];
421 if ( is_array( $value ) ) {
422 $attribs['data-subprojects'] = implode( ' ', $value );
423 }
424 if ( $this->interwiki === $key ) {
425 $attribs['selected'] = 'selected';
426 }
427 $out->addHTML( Html::element( 'option', $attribs, $key ) );
428 }
429
430 $out->addHTML(
431 Xml::closeElement( 'select' )
432 );
433
434 if ( $needSubprojectField ) {
435 $out->addHTML(
436 Xml::openElement(
437 'select',
438 [ 'name' => 'subproject', 'id' => 'subproject' ]
439 )
440 );
441
442 $subprojectsToAdd = [];
443 foreach ( $this->importSources as $key => $value ) {
444 if ( is_array( $value ) ) {
445 $subprojectsToAdd = array_merge( $subprojectsToAdd, $value );
446 }
447 }
448 $subprojectsToAdd = array_unique( $subprojectsToAdd );
449 sort( $subprojectsToAdd );
450 foreach ( $subprojectsToAdd as $subproject ) {
451 $out->addHTML( Xml::option( $subproject, $subproject, $this->subproject === $subproject ) );
452 }
453
454 $out->addHTML(
455 Xml::closeElement( 'select' )
456 );
457 }
458
459 $out->addHTML(
460 "</td>
461 </tr>
462 <tr>
463 <td class='mw-label'>" .
464 Xml::label( $this->msg( 'import-interwiki-sourcepage' )->text(), 'frompage' ) .
465 "</td>
466 <td class='mw-input'>" .
467 Xml::input( 'frompage', 50, $this->frompage, [ 'id' => 'frompage' ] ) .
468 "</td>
469 </tr>
470 <tr>
471 <td>
472 </td>
473 <td class='mw-input'>" .
474 Xml::checkLabel(
475 $this->msg( 'import-interwiki-history' )->text(),
476 'interwikiHistory',
477 'interwikiHistory',
478 $this->history
479 ) .
480 "</td>
481 </tr>
482 <tr>
483 <td>
484 </td>
485 <td class='mw-input'>" .
486 Xml::checkLabel(
487 $this->msg( 'import-interwiki-templates' )->text(),
488 'interwikiTemplates',
489 'interwikiTemplates',
490 $this->includeTemplates
491 ) .
492 "</td>
493 </tr>
494 $importDepth
495 <tr>
496 <td class='mw-label'>" .
497 Xml::label( $this->msg( 'import-comment' )->text(), 'mw-interwiki-comment' ) .
498 "</td>
499 <td class='mw-input'>" .
500 Xml::input( 'log-comment', 50,
501 ( $this->sourceName === 'interwiki' ? $this->logcomment : '' ),
502 [ 'id' => 'mw-interwiki-comment', 'type' => 'text' ] ) . ' ' .
503 "</td>
504 </tr>
505 $mappingSelection
506 <tr>
507 <td>
508 </td>
509 <td class='mw-submit'>" .
510 Xml::submitButton(
511 $this->msg( 'import-interwiki-submit' )->text(),
512 Linker::tooltipAndAccesskeyAttribs( 'import' )
513 ) .
514 "</td>
515 </tr>" .
516 Xml::closeElement( 'table' ) .
517 Xml::closeElement( 'form' ) .
518 Xml::closeElement( 'fieldset' )
519 );
520 }
521 }
522
523 protected function getGroupName() {
524 return 'pagetools';
525 }
526 }
527
528 /**
529 * Reporting callback
530 * @ingroup SpecialPage
531 */
532 class ImportReporter extends ContextSource {
533 private $reason = false;
534 private $logTags = [];
535 private $mOriginalLogCallback = null;
536 private $mOriginalPageOutCallback = null;
537 private $mLogItemCount = 0;
538
539 /**
540 * @param WikiImporter $importer
541 * @param bool $upload
542 * @param string $interwiki
543 * @param string|bool $reason
544 */
545 function __construct( $importer, $upload, $interwiki, $reason = false ) {
546 $this->mOriginalPageOutCallback =
547 $importer->setPageOutCallback( [ $this, 'reportPage' ] );
548 $this->mOriginalLogCallback =
549 $importer->setLogItemCallback( [ $this, 'reportLogItem' ] );
550 $importer->setNoticeCallback( [ $this, 'reportNotice' ] );
551 $this->mPageCount = 0;
552 $this->mIsUpload = $upload;
553 $this->mInterwiki = $interwiki;
554 $this->reason = $reason;
555 }
556
557 /**
558 * Sets change tags to apply to the import log entry and null revision.
559 *
560 * @param array $tags
561 * @since 1.29
562 */
563 public function setChangeTags( array $tags ) {
564 $this->logTags = $tags;
565 }
566
567 function open() {
568 $this->getOutput()->addHTML( "<ul>\n" );
569 }
570
571 function reportNotice( $msg, array $params ) {
572 $this->getOutput()->addHTML(
573 Html::element( 'li', [], $this->msg( $msg, $params )->text() )
574 );
575 }
576
577 function reportLogItem( /* ... */ ) {
578 $this->mLogItemCount++;
579 if ( is_callable( $this->mOriginalLogCallback ) ) {
580 call_user_func_array( $this->mOriginalLogCallback, func_get_args() );
581 }
582 }
583
584 /**
585 * @param Title $title
586 * @param ForeignTitle $foreignTitle
587 * @param int $revisionCount
588 * @param int $successCount
589 * @param array $pageInfo
590 * @return void
591 */
592 public function reportPage( $title, $foreignTitle, $revisionCount,
593 $successCount, $pageInfo ) {
594 $args = func_get_args();
595 call_user_func_array( $this->mOriginalPageOutCallback, $args );
596
597 if ( $title === null ) {
598 # Invalid or non-importable title; a notice is already displayed
599 return;
600 }
601
602 $this->mPageCount++;
603 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
604 if ( $successCount > 0 ) {
605 // <bdi> prevents jumbling of the versions count
606 // in RTL wikis in case the page title is LTR
607 $this->getOutput()->addHTML(
608 "<li>" . $linkRenderer->makeLink( $title ) . " " .
609 "<bdi>" .
610 $this->msg( 'import-revision-count' )->numParams( $successCount )->escaped() .
611 "</bdi>" .
612 "</li>\n"
613 );
614
615 $logParams = [ '4:number:count' => $successCount ];
616 if ( $this->mIsUpload ) {
617 $detail = $this->msg( 'import-logentry-upload-detail' )->numParams(
618 $successCount )->inContentLanguage()->text();
619 $action = 'upload';
620 } else {
621 $pageTitle = $foreignTitle->getFullText();
622 $fullInterwikiPrefix = $this->mInterwiki;
623 Hooks::run( 'ImportLogInterwikiLink', [ &$fullInterwikiPrefix, &$pageTitle ] );
624
625 $interwikiTitleStr = $fullInterwikiPrefix . ':' . $pageTitle;
626 $interwiki = '[[:' . $interwikiTitleStr . ']]';
627 $detail = $this->msg( 'import-logentry-interwiki-detail' )->numParams(
628 $successCount )->params( $interwiki )->inContentLanguage()->text();
629 $action = 'interwiki';
630 $logParams['5:title-link:interwiki'] = $interwikiTitleStr;
631 }
632 if ( $this->reason ) {
633 $detail .= $this->msg( 'colon-separator' )->inContentLanguage()->text()
634 . $this->reason;
635 }
636
637 $comment = $detail; // quick
638 $dbw = wfGetDB( DB_MASTER );
639 $latest = $title->getLatestRevID();
640 $nullRevision = Revision::newNullRevision(
641 $dbw,
642 $title->getArticleID(),
643 $comment,
644 true,
645 $this->getUser()
646 );
647
648 $nullRevId = null;
649 if ( !is_null( $nullRevision ) ) {
650 $nullRevId = $nullRevision->insertOn( $dbw );
651 $page = WikiPage::factory( $title );
652 # Update page record
653 $page->updateRevisionOn( $dbw, $nullRevision );
654 Hooks::run(
655 'NewRevisionFromEditComplete',
656 [ $page, $nullRevision, $latest, $this->getUser() ]
657 );
658 }
659
660 // Create the import log entry
661 $logEntry = new ManualLogEntry( 'import', $action );
662 $logEntry->setTarget( $title );
663 $logEntry->setComment( $this->reason );
664 $logEntry->setPerformer( $this->getUser() );
665 $logEntry->setParameters( $logParams );
666 $logid = $logEntry->insert();
667 if ( count( $this->logTags ) ) {
668 $logEntry->setTags( $this->logTags );
669 }
670 // Make sure the null revision will be tagged as well
671 $logEntry->setAssociatedRevId( $nullRevId );
672
673 $logEntry->publish( $logid );
674
675 } else {
676 $this->getOutput()->addHTML( "<li>" . $linkRenderer->makeKnownLink( $title ) . " " .
677 $this->msg( 'import-nonewrevisions' )->escaped() . "</li>\n" );
678 }
679 }
680
681 function close() {
682 $out = $this->getOutput();
683 if ( $this->mLogItemCount > 0 ) {
684 $msg = $this->msg( 'imported-log-entries' )->numParams( $this->mLogItemCount )->parse();
685 $out->addHTML( Xml::tags( 'li', null, $msg ) );
686 } elseif ( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) {
687 $out->addHTML( "</ul>\n" );
688
689 return Status::newFatal( 'importnopages' );
690 }
691 $out->addHTML( "</ul>\n" );
692
693 return Status::newGood( $this->mPageCount );
694 }
695 }