* Use local context to get messages
[lhc/web/wiklou.git] / includes / Export.php
index e530b88..35a1b5b 100644 (file)
@@ -476,7 +476,7 @@ class XmlDumpWriter {
        function openPage( $row ) {
                $out = "  <page>\n";
                $title = Title::makeTitle( $row->page_namespace, $row->page_title );
-               $out .= '    ' . Xml::elementClean( 'title', array(), $title->getPrefixedText() ) . "\n";
+               $out .= '    ' . Xml::elementClean( 'title', array(), self::canonicalTitle( $title ) ) . "\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 ) {
@@ -486,6 +486,13 @@ class XmlDumpWriter {
                                $out .= '    ' . Xml::element( 'redirect', array( 'title' => self::canonicalTitle( $redirect ) ) ) . "\n";
                        }
                }
+
+               if ( $row->rev_sha1 ) {
+                       $out .= "      " . Xml::element('sha1', null, strval( $row->rev_sha1 ) ) . "\n";
+               } else {
+                       $out .= "      <sha1/>\n";
+               }
+
                if ( $row->page_restrictions != '' ) {
                        $out .= '    ' . Xml::element( 'restrictions', array(),
                                strval( $row->page_restrictions ) ) . "\n";
@@ -500,6 +507,7 @@ class XmlDumpWriter {
         * Closes a <page> section on the output stream.
         *
         * @access private
+        * @return string
         */
        function closePage() {
                return "  </page>\n";
@@ -521,12 +529,6 @@ class XmlDumpWriter {
 
                $out .= $this->writeTimestamp( $row->rev_timestamp );
 
-               if ( $row->rev_sha1 ) {
-                       $out .= "      " . Xml::element('sha1', null, strval($row->rev_sha1) ) . "\n";
-               } else {
-                       $out .= "      <sha1/>\n";
-               }
-               
                if ( $row->rev_deleted & Revision::DELETED_USER ) {
                        $out .= "      " . Xml::element( 'contributor', array( 'deleted' => 'deleted' ) ) . "\n";
                } else {
@@ -632,6 +634,7 @@ class XmlDumpWriter {
 
        /**
         * Warning! This data is potentially inconsistent. :(
+        * @return string
         */
        function writeUploads( $row, $dumpContents = false ) {
                if ( $row->page_namespace == NS_IMAGE ) {
@@ -772,6 +775,7 @@ class DumpOutput {
        /**
         * Returns the name of the file or files which are
         * being written to, if there are any.
+        * @return null
         */
        function getFilenames() {
                return NULL;