From a9a452980b7c719af308107884e483b9aa47ab92 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Wed, 20 Jul 2011 20:12:48 +0000 Subject: [PATCH] * $wgDnsBlacklistUrls now accepts an array with url and key as the elements to work with DNSBLs that require keys, such as Project Honeypot. --- RELEASE-NOTES-1.19 | 3 +++ includes/User.php | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 5efd328487..287c08456d 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -15,6 +15,9 @@ production. === New features in 1.19 === * (bug 19838) Possibility to get all interwiki prefixes if the interwiki cache is used. +* $wgDnsBlacklistUrls now accepts an array with url and key as the + elements to work with DNSBLs that require keys, such as + Project Honeypot. === Bug fixes in 1.19 === * $wgUploadNavigationUrl should be used for file redlinks if diff --git a/includes/User.php b/includes/User.php index 3d273c4c0c..b011be446f 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1339,7 +1339,17 @@ class User { foreach( (array)$bases as $base ) { # Make hostname - $host = "$ipReversed.$base"; + # If we have an access key, use that too (ProjectHoneypot, etc.) + if( is_array( $base ) ) { + if( count( $base ) >= 2 ) { + # Access key is 1, base URL is 0 + $host = "{$base[1]}.$ipReversed.{$base[0]}"; + } else { + $host = "$ipReversed.{$base[0]}"; + } + } else { + $host = "$ipReversed.$base"; + } # Send query $ipList = gethostbynamel( $host ); -- 2.20.1