Put the sha1 tag in <revision> and not wrongly in <page>
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 23 Mar 2012 20:09:59 +0000 (13:09 -0700)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 23 Mar 2012 20:29:05 +0000 (13:29 -0700)
Change 1: while at it, also don't show the SHA1 if rev_deleted is set

Change-Id: I0d94338915e754bdee878d1e6570e2efc481b2b2

includes/Export.php

index 35a1b5b..82aa946 100644 (file)
@@ -487,12 +487,6 @@ class XmlDumpWriter {
                        }
                }
 
-               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";
@@ -560,6 +554,12 @@ class XmlDumpWriter {
                                "" ) . "\n";
                }
 
+               if ( $row->rev_sha1 && !( $row->rev_deleted & Revision::DELETED_TEXT ) ) {
+                       $out .= "      " . Xml::element('sha1', null, strval( $row->rev_sha1 ) ) . "\n";
+               } else {
+                       $out .= "      <sha1/>\n";
+               }
+
                wfRunHooks( 'XmlDumpWriterWriteRevision', array( &$this, &$out, $row, $text ) );
 
                $out .= "    </revision>\n";