r103582 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103581‎ | r103582 | r103583 >
Date:09:08, 18 November 2011
Author:ariel
Status:ok
Tags:
Comment:
followup to r103448, tighten up code
Modified paths:
  • /trunk/phase3/includes/Export.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Export.php
@@ -614,17 +614,11 @@
615615
616616 function writeContributor( $id, $text ) {
617617 $out = " <contributor>\n";
618 - if ( $id ) {
 618+ if ( $id || !IP::isValid( $text ) ) {
619619 $out .= " " . Xml::elementClean( 'username', null, strval( $text ) ) . "\n";
620620 $out .= " " . Xml::element( 'id', null, strval( $id ) ) . "\n";
621621 } else {
622 - if ( IP::isValid( $text ) ) {
623 - $out .= " " . Xml::elementClean( 'ip', null, strval( $text ) ) . "\n";
624 - }
625 - else {
626 - $out .= " " . Xml::elementClean( 'username', null, strval( $text ) ) . "\n";
627 - $out .= " " . Xml::element( 'id', null, strval( $id ) ) . "\n";
628 - }
 622+ $out .= " " . Xml::elementClean( 'ip', null, strval( $text ) ) . "\n";
629623 }
630624 $out .= " </contributor>\n";
631625 return $out;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103448if user id is 0 and username is actually an IP, write it as <ip>, not <username>ariel09:20, 17 November 2011

Status & tagging log