X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FExport.php;h=16c297ee5cfc01534b58e2a1d9006c9219cdc02e;hb=b23188b8adc15c477b1cecc138af2f35c95d82e8;hp=e2b01b5397bf762bfe5ff828db4f05b17fc17919;hpb=e8b571fbf1a41ac2a2000b2a515393494d93a806;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Export.php b/includes/Export.php index e2b01b5397..16c297ee5c 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -427,10 +427,10 @@ class WikiExporter { protected function outputPageStream( $resultset ) { $last = null; foreach ( $resultset as $row ) { - if ( is_null( $last ) || + if ( $last === null || $last->page_namespace != $row->page_namespace || $last->page_title != $row->page_title ) { - if ( isset( $last ) ) { + if ( $last !== null ) { $output = ''; if ( $this->dumpUploads ) { $output .= $this->writer->writeUploads( $last, $this->dumpUploadFileContents ); @@ -445,7 +445,7 @@ class WikiExporter { $output = $this->writer->writeRevision( $row ); $this->sink->writeRevision( $row, $output ); } - if ( isset( $last ) ) { + if ( $last !== null ) { $output = ''; if ( $this->dumpUploads ) { $output .= $this->writer->writeUploads( $last, $this->dumpUploadFileContents ); @@ -636,29 +636,29 @@ class XmlDumpWriter { $out = " \n"; $out .= " " . Xml::element( 'id', null, strval( $row->rev_id ) ) . "\n"; - if( $row->rev_parent_id ) { + if( isset( $row->rev_parent_id ) && $row->rev_parent_id ) { $out .= " " . Xml::element( 'parentid', null, strval( $row->rev_parent_id ) ) . "\n"; } $out .= $this->writeTimestamp( $row->rev_timestamp ); - if ( $row->rev_deleted & Revision::DELETED_USER ) { + if ( isset( $row->rev_deleted ) && ( $row->rev_deleted & Revision::DELETED_USER ) ) { $out .= " " . Xml::element( 'contributor', array( 'deleted' => 'deleted' ) ) . "\n"; } else { $out .= $this->writeContributor( $row->rev_user, $row->rev_user_text ); } - if ( $row->rev_minor_edit ) { + if ( isset( $row->rev_minor_edit ) && $row->rev_minor_edit ) { $out .= " \n"; } - if ( $row->rev_deleted & Revision::DELETED_COMMENT ) { + if ( isset( $row->rev_deleted ) && ( $row->rev_deleted & Revision::DELETED_COMMENT ) ) { $out .= " " . Xml::element( 'comment', array( 'deleted' => 'deleted' ) ) . "\n"; } elseif ( $row->rev_comment != '' ) { $out .= " " . Xml::elementClean( 'comment', array(), strval( $row->rev_comment ) ) . "\n"; } $text = ''; - if ( $row->rev_deleted & Revision::DELETED_TEXT ) { + if ( isset( $row->rev_deleted ) && ( $row->rev_deleted & Revision::DELETED_TEXT ) ) { $out .= " " . Xml::element( 'text', array( 'deleted' => 'deleted' ) ) . "\n"; } elseif ( isset( $row->old_text ) ) { // Raw text from the database may have invalid chars @@ -673,7 +673,7 @@ class XmlDumpWriter { "" ) . "\n"; } - if ( $row->rev_sha1 && !( $row->rev_deleted & Revision::DELETED_TEXT ) ) { + if ( isset( $row->rev_sha1 ) && $row->rev_sha1 && !( $row->rev_deleted & Revision::DELETED_TEXT ) ) { $out .= " " . Xml::element('sha1', null, strval( $row->rev_sha1 ) ) . "\n"; } else { $out .= " \n";