From eadfd5a5819ff2752675f3bdd62f31f8e9125ece Mon Sep 17 00:00:00 2001 From: Diederik van Liere Date: Wed, 9 Nov 2011 21:15:48 +0000 Subject: [PATCH] Commit to fix bug 30513. --- docs/export-0.5.xsd | 2 + docs/export-0.6.xsd | 225 ++++++++++++++++++++++++++++++++++++++++++++ includes/Export.php | 11 ++- 3 files changed, 235 insertions(+), 3 deletions(-) create mode 100644 docs/export-0.6.xsd diff --git a/docs/export-0.5.xsd b/docs/export-0.5.xsd index ca54c93872..469446db38 100644 --- a/docs/export-0.5.xsd +++ b/docs/export-0.5.xsd @@ -12,6 +12,8 @@ Version 0.4 adds per-revision delete flags, log exports, discussion threading data, a per-page redirect flag, and per-namespace capitalization. + + Version 0.5 adds byte count per revision. The canonical URL to the schema document is: http://www.mediawiki.org/xml/export-0.5.xsd diff --git a/docs/export-0.6.xsd b/docs/export-0.6.xsd new file mode 100644 index 0000000000..a225e5206c --- /dev/null +++ b/docs/export-0.6.xsd @@ -0,0 +1,225 @@ + + + + + + + MediaWiki's page export format + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/includes/Export.php b/includes/Export.php index a9f29cbc79..53211e1240 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -380,7 +380,7 @@ class XmlDumpWriter { * @return string */ function schemaVersion() { - return "0.5"; + return "0.6"; } /** @@ -476,10 +476,15 @@ class XmlDumpWriter { function openPage( $row ) { $out = " \n"; $title = Title::makeTitle( $row->page_namespace, $row->page_title ); - $out .= ' ' . Xml::elementClean( 'title', array(), $title->getPrefixedText() ) . "\n"; + $out .= ' ' . Xml::elementClean( 'title', array(), strval( $title->getPrefixedText() ) ) . "\n"; + $out .= ' ' . Xml::element( 'ns', array(), strval( $row->page_namespace) ) . "\n"; $out .= ' ' . Xml::element( 'id', array(), strval( $row->page_id ) ) . "\n"; if ( $row->page_is_redirect ) { - $out .= ' ' . Xml::element( 'redirect', array() ) . "\n"; + $page = WikiPage::factory( $title ); + $redirect = $page->getRedirectTarget(); + if ( $redirect !== null ) { + $out .= ' ' . Xml::element( 'redirect', array( 'title' => strval( $redirect ) ) ) . "\n"; + } } if ( $row->page_restrictions != '' ) { $out .= ' ' . Xml::element( 'restrictions', array(), -- 2.20.1