r58054 - Code Review

From MediaWiki.org
Jump to: navigation, search
Repository:MediaWiki
Revision:r58053 | r58054 (on ViewVC) | r58055 >
Date:16:44, 23 October 2009
Author:ialex
Status:ok
Tags:
Comment:* (bug 21255) Fixed hostname construction for DNSBL checking

Based on a patch by Antonio Ospite - http://bug-attachment.wikimedia.org/attachment.cgi?id=6707
Modified paths:

Test cases

ParserTests

559 succeeded tests

Diff [purge]

Index: trunk/phase3/CREDITS
===================================================================
--- trunk/phase3/CREDITS	(revision 58053)
+++ trunk/phase3/CREDITS	(revision 58054)
@@ -59,6 +59,7 @@
 == Patch Contributors ==
 * Agbad
 * Ahmad Sherif
+* Antonio Ospite
 * Azliq7
 * Borislav Manolov
 * Brad Jorsch
Index: trunk/phase3/includes/User.php
===================================================================
--- trunk/phase3/includes/User.php	(revision 58053)
+++ trunk/phase3/includes/User.php	(revision 58054)
@@ -1195,8 +1195,11 @@
 		$host = '';
 		// FIXME: IPv6 ???  (http://bugs.php.net/bug.php?id=33170)
 		if( IP::isIPv4( $ip ) ) {
+			# Reverse IP, bug 21255
+			$ipReversed = implode( '.', array_reverse( explode( '.', $ip ) ) );
+
 			# Make hostname
-			$host = "$ip.$base";
+			$host = "$ipReversed.$base";
 
 			# Send query
 			$ipList = gethostbynamel( $host );
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 58053)
+++ trunk/phase3/RELEASE-NOTES	(revision 58054)
@@ -589,6 +589,7 @@
 * (bug 21234) Moving subpages of titles containing \\ now works properly
 * (bug 21006) maintenance/updateArticleCount.php now works again on PostgreSQL
 * (bug 19319) Add activeusers-intro message at top of SpecialActiveUsers page
+* (bug 21255) Fixed hostname construction for DNSBL checking
 
 == API changes in 1.16 ==
 

Status & tagging log

Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox