* $wgDnsBlacklistUrls now accepts an array with url and key as the elements to work...
authorRyan Schmidt <skizzerz@users.mediawiki.org>
Wed, 20 Jul 2011 20:12:48 +0000 (20:12 +0000)
committerRyan Schmidt <skizzerz@users.mediawiki.org>
Wed, 20 Jul 2011 20:12:48 +0000 (20:12 +0000)
RELEASE-NOTES-1.19
includes/User.php

index 5efd328..287c084 100644 (file)
@@ -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
index 3d273c4..b011be4 100644 (file)
@@ -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 );