Index: trunk/phase3/includes/api/ApiQuery.php |
— | — | @@ -457,15 +457,27 @@ |
458 | 458 | $result->addValue( 'query', 'pages', $pages ); |
459 | 459 | } |
460 | 460 | if ( $this->params['export'] ) { |
| 461 | + $exportTitles = array(); |
| 462 | + $titles = $pageSet->getGoodTitles(); |
| 463 | + if( count( $titles ) ) { |
| 464 | + foreach ( $titles as $title ) { |
| 465 | + if ( $title->userCanRead() ) { |
| 466 | + $exportTitles[] = $title; |
| 467 | + } |
| 468 | + } |
| 469 | + } |
| 470 | + //export, when there are titles |
| 471 | + if ( !count( $exportTitles ) ) { |
| 472 | + return; |
| 473 | + } |
| 474 | + |
461 | 475 | $exporter = new WikiExporter( $this->getDB() ); |
462 | 476 | // WikiExporter writes to stdout, so catch its |
463 | 477 | // output with an ob |
464 | 478 | ob_start(); |
465 | 479 | $exporter->openStream(); |
466 | | - foreach ( $pageSet->getGoodTitles() as $title ) { |
467 | | - if ( $title->userCanRead() ) { |
468 | | - $exporter->pageByTitle( $title ); |
469 | | - } |
| 480 | + foreach ( $exportTitles as $title ) { |
| 481 | + $exporter->pageByTitle( $title ); |
470 | 482 | } |
471 | 483 | $exporter->closeStream(); |
472 | 484 | $exportxml = ob_get_contents(); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -449,6 +449,8 @@ |
450 | 450 | used, rvlimit is enforced to 1. |
451 | 451 | * If a action=parse request provides an oldid that is actually the current revision |
452 | 452 | id, try the parser cache, and save it to it if necessary |
| 453 | +* (bug 25463) Export header should not be shown if no pages were requested, to |
| 454 | + reduce confusion |
453 | 455 | |
454 | 456 | === Languages updated in 1.17 === |
455 | 457 | |