followup to r103448, tighten up code
authorAriel Glenn <ariel@users.mediawiki.org>
Fri, 18 Nov 2011 09:08:29 +0000 (09:08 +0000)
committerAriel Glenn <ariel@users.mediawiki.org>
Fri, 18 Nov 2011 09:08:29 +0000 (09:08 +0000)
includes/Export.php

index 4521434..dec604e 100644 (file)
@@ -614,17 +614,11 @@ class XmlDumpWriter {
 
        function writeContributor( $id, $text ) {
                $out = "      <contributor>\n";
-               if ( $id ) {
+               if ( $id || !IP::isValid( $text ) ) {
                        $out .= "        " . Xml::elementClean( 'username', null, strval( $text ) ) . "\n";
                        $out .= "        " . Xml::element( 'id', null, strval( $id ) ) . "\n";
                } else {
-                       if ( IP::isValid( $text ) ) {
-                               $out .= "        " . Xml::elementClean( 'ip', null, strval( $text ) ) . "\n";
-                       }
-                       else {
-                               $out .= "        " . Xml::elementClean( 'username', null, strval( $text ) ) . "\n";
-                               $out .= "        " . Xml::element( 'id', null, strval( $id ) ) . "\n";
-                       }
+                       $out .= "        " . Xml::elementClean( 'ip', null, strval( $text ) ) . "\n";
                }
                $out .= "      </contributor>\n";
                return $out;