f-prot isn't so open now, so might aswell not advertise it in DefaultSetttings under...
[lhc/web/wiklou.git] / includes / Export.php
index 0bfcd74..36d98d6 100644 (file)
@@ -468,7 +468,7 @@ class XmlDumpWriter {
         * @return string
         */
        function schemaVersion() {
-               return "0.6";
+               return "0.7";
        }
 
        /**
@@ -626,6 +626,9 @@ class XmlDumpWriter {
 
                $out  = "    <revision>\n";
                $out .= "      " . Xml::element( 'id', null, strval( $row->rev_id ) ) . "\n";
+               if( $row->rev_parent_id ) {
+                       $out .= "      " . Xml::element( 'parentid', null, strval( $row->rev_parent_id ) ) . "\n";
+               }
 
                $out .= $this->writeTimestamp( $row->rev_timestamp );
 
@@ -754,7 +757,7 @@ class XmlDumpWriter {
         * @return string
         */
        function writeUploads( $row, $dumpContents = false ) {
-               if ( $row->page_namespace == NS_IMAGE ) {
+               if ( $row->page_namespace == NS_FILE ) {
                        $img = wfLocalFile( $row->page_title );
                        if ( $img && $img->exists() ) {
                                $out = '';
@@ -789,10 +792,15 @@ class XmlDumpWriter {
                } else {
                        $contents = '';
                }
+               if ( $file->isDeleted( File::DELETED_COMMENT ) ) {
+                       $comment = Xml::element( 'comment', array( 'deleted' => 'deleted' ) );
+               } else {
+                       $comment = Xml::elementClean( 'comment', null, $file->getDescription() );
+               }
                return "    <upload>\n" .
                        $this->writeTimestamp( $file->getTimestamp() ) .
                        $this->writeContributor( $file->getUser( 'id' ), $file->getUser( 'text' ) ) .
-                       "      " . Xml::elementClean( 'comment', null, $file->getDescription() ) . "\n" .
+                       "      " . $comment . "\n" .
                        "      " . Xml::element( 'filename', null, $file->getName() ) . "\n" .
                        $archiveName .
                        "      " . Xml::element( 'src', null, $file->getCanonicalUrl() ) . "\n" .