*/
$catpages = $this->getPagesFromCategory( $t );
if ( $catpages ) {
- $page .= "\n" . implode( "\n", $catpages );
+ if ( $page !== '' ) {
+ $page .= "\n";
+ }
+ $page .= implode( "\n", $catpages );
}
}
}
$exporter->allPages();
} else {
foreach ( $pages as $page ) {
- #Bug 8824: Only export pages the user can read
+ # Bug 8824: Only export pages the user can read
$title = Title::newFromText( $page );
if ( is_null( $title ) ) {
// @todo Perhaps output an <error> tag or something.