Index: trunk/phase3/includes/User.php |
— | — | @@ -1185,10 +1185,10 @@ |
1186 | 1186 | * Whether the given IP is in a given DNS blacklist. |
1187 | 1187 | * |
1188 | 1188 | * @param $ip \string IP to check |
1189 | | - * @param $base \string URL of the DNS blacklist |
| 1189 | + * @param $bases \string or Array of Strings: URL of the DNS blacklist |
1190 | 1190 | * @return \bool True if blacklisted. |
1191 | 1191 | */ |
1192 | | - function inDnsBlacklist( $ip, $base ) { |
| 1192 | + function inDnsBlacklist( $ip, $bases ) { |
1193 | 1193 | wfProfileIn( __METHOD__ ); |
1194 | 1194 | |
1195 | 1195 | $found = false; |
— | — | @@ -1198,17 +1198,20 @@ |
1199 | 1199 | # Reverse IP, bug 21255 |
1200 | 1200 | $ipReversed = implode( '.', array_reverse( explode( '.', $ip ) ) ); |
1201 | 1201 | |
1202 | | - # Make hostname |
1203 | | - $host = "$ipReversed.$base"; |
| 1202 | + foreach( (array)$bases as $base ) { |
| 1203 | + # Make hostname |
| 1204 | + $host = "$ipReversed.$base"; |
1204 | 1205 | |
1205 | | - # Send query |
1206 | | - $ipList = gethostbynamel( $host ); |
| 1206 | + # Send query |
| 1207 | + $ipList = gethostbynamel( $host ); |
1207 | 1208 | |
1208 | | - if( $ipList ) { |
1209 | | - wfDebug( "Hostname $host is {$ipList[0]}, it's a proxy says $base!\n" ); |
1210 | | - $found = true; |
1211 | | - } else { |
1212 | | - wfDebug( "Requested $host, not found in $base.\n" ); |
| 1209 | + if( $ipList ) { |
| 1210 | + wfDebug( "Hostname $host is {$ipList[0]}, it's a proxy says $base!\n" ); |
| 1211 | + $found = true; |
| 1212 | + break; |
| 1213 | + } else { |
| 1214 | + wfDebug( "Requested $host, not found in $base.\n" ); |
| 1215 | + } |
1213 | 1216 | } |
1214 | 1217 | } |
1215 | 1218 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -3531,12 +3531,16 @@ |
3532 | 3532 | $wgEnableTooltipsAndAccesskeys = true; |
3533 | 3533 | |
3534 | 3534 | /** |
3535 | | - * Use http.dnsbl.sorbs.net to check for open proxies |
| 3535 | + * Whether to use DNS blacklists in $wgSorbsUrl to check for open proxies |
3536 | 3536 | */ |
3537 | 3537 | $wgEnableSorbs = false; |
3538 | | -$wgSorbsUrl = 'http.dnsbl.sorbs.net.'; |
3539 | 3538 | |
3540 | 3539 | /** |
| 3540 | + * List of DNS blacklists to use, if $wgEnableSorbs is true |
| 3541 | + */ |
| 3542 | +$wgSorbsUrl = array( 'http.dnsbl.sorbs.net.' ); |
| 3543 | + |
| 3544 | +/** |
3541 | 3545 | * Proxy whitelist, list of addresses that are assumed to be non-proxy despite |
3542 | 3546 | * what the other methods might say. |
3543 | 3547 | */ |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -90,6 +90,7 @@ |
91 | 91 | * New hook AbortNewAccountAuto, called before account creation from AuthPlugin- |
92 | 92 | or ExtUser-driven requests. |
93 | 93 | * $wgCapitalLinkOverrides added to configure per-namespace capitalization |
| 94 | +* (bug 21172) $wgSorbsUrl can now be an array with multiple DNSBL |
94 | 95 | |
95 | 96 | === New features in 1.16 === |
96 | 97 | |