https://www.mediawiki.org/wiki/Special:Code/MediaWiki/103448

Revision: 103448
Author:   ariel
Date:     2011-11-17 09:20:51 +0000 (Thu, 17 Nov 2011)
Log Message:
-----------
if user id is 0 and username is actually an IP, write it as <ip>, not <username>

Modified Paths:
--------------
    trunk/phase3/includes/Export.php

Modified: trunk/phase3/includes/Export.php
===================================================================
--- trunk/phase3/includes/Export.php    2011-11-17 08:03:14 UTC (rev 103447)
+++ trunk/phase3/includes/Export.php    2011-11-17 09:20:51 UTC (rev 103448)
@@ -618,7 +618,13 @@
                        $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 .= "      </contributor>\n";
                return $out;


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to