From 81cc6c7b4c9358338b82e70d3f7219e6ea0ef667 Mon Sep 17 00:00:00 2001 From: Ariel Glenn Date: Thu, 17 Nov 2011 09:20:51 +0000 Subject: [PATCH] if user id is 0 and username is actually an IP, write it as , not --- includes/Export.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Export.php b/includes/Export.php index 3d2a8c4956..4521434e8b 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -618,7 +618,13 @@ class XmlDumpWriter { $out .= " " . Xml::elementClean( 'username', null, strval( $text ) ) . "\n"; $out .= " " . Xml::element( 'id', null, strval( $id ) ) . "\n"; } else { - $out .= " " . Xml::elementClean( 'ip', null, strval( $text ) ) . "\n"; + 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 .= " \n"; return $out; -- 2.20.1