From d106268c35eb5ac9a41a3e99aa33fac75afd7b2d Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 23 Oct 2009 16:44:10 +0000 Subject: [PATCH] * (bug 21255) Fixed hostname construction for DNSBL checking Based on a patch by Antonio Ospite - http://bug-attachment.wikimedia.org/attachment.cgi?id=6707 --- CREDITS | 1 + RELEASE-NOTES | 1 + includes/User.php | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 549c8d00f6..86a1e3e98a 100644 --- a/CREDITS +++ b/CREDITS @@ -59,6 +59,7 @@ following names for their contribution to the product. == Patch Contributors == * Agbad * Ahmad Sherif +* Antonio Ospite * Azliq7 * Borislav Manolov * Brad Jorsch diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1a402e93b2..a676933641 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -589,6 +589,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (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 == diff --git a/includes/User.php b/includes/User.php index fd97f3bef2..daab4539be 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1195,8 +1195,11 @@ class User { $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 ); -- 2.20.1