* renamed $wgEnableSorbs to $wgEnableDnsBlacklist and $wgSorbsUrl to $wgDnsBlacklistUrls (backward compatibility kept)
* renamed User::inSorbsBlacklist() to User::isDnsBlacklisted()
* $wgUploadMaintenance added to disable file deletions and restorations during
maintenance
* $wgCapitalLinkOverrides added to configure per-namespace capitalization
-* (bug 21172) $wgSorbsUrl can now be an array with multiple DNSBL
+* (bug 21172) $wgSorbsUrl can now be an array with multiple DNSBL and renamed
+ to $wgDnsBlacklistUrls (backward compatibility kept)
* $wgEnableHtmlDiff has been removed
* (bug 3340) $wgBlockCIDRLimit added (default: 16) to configure the low end of
CIDR ranges for blocking
* $wgDBAhandler added to choose a DBA handler when using CACHE_DBA
* $wgPreviewOnOpenNamespaces for extensions that create namespaces that behave
similarly to the category namespace.
+* $wgEnableSorbs renamed to $wgDnsBlacklistUrls ($wgEnableSorbs kept for
+ backward compatibility)
=== New features in 1.16 ===
$wgEnableTooltipsAndAccesskeys = true;
/**
- * Whether to use DNS blacklists in $wgSorbsUrl to check for open proxies
+ * Whether to use DNS blacklists in $wgDnsBlacklistUrls to check for open proxies
+ * @since 1.16
+ */
+$wgEnableDnsBlacklist = false;
+
+/**
+ * @deprecated Use $wgEnableDnsBlacklist instead, only kept for backward
+ * compatibility
*/
$wgEnableSorbs = false;
/**
- * List of DNS blacklists to use, if $wgEnableSorbs is true
+ * List of DNS blacklists to use, if $wgEnableDnsBlacklist is true
+ * @since 1.16
+ */
+$wgDnsBlacklistUrls = array( 'http.dnsbl.sorbs.net.' );
+
+/**
+ * @deprecated Use $wgDnsBlacklistUrls instead, only kept for backward
+ * compatibility
*/
-$wgSorbsUrl = array( 'http.dnsbl.sorbs.net.' );
+$wgSorbsUrl = array();
/**
* Proxy whitelist, list of addresses that are assumed to be non-proxy despite
* done against master.
*/
function getBlockedStatus( $bFromSlave = true ) {
- global $wgEnableSorbs, $wgProxyWhitelist, $wgUser;
+ global $wgProxyWhitelist, $wgUser;
if ( -1 != $this->mBlockedby ) {
wfDebug( "User::getBlockedStatus: already loaded.\n" );
}
# DNSBL
- if ( !$this->mBlockedby && $wgEnableSorbs && !$this->getID() ) {
- if ( $this->inSorbsBlacklist( $ip ) ) {
+ if ( !$this->mBlockedby && !$this->getID() ) {
+ if ( $this->isDnsBlacklisted( $ip ) ) {
$this->mBlockedby = wfMsg( 'sorbs' );
$this->mBlockreason = wfMsg( 'sorbsreason' );
}
}
/**
- * Whether the given IP is in the SORBS blacklist.
+ * Whether the given IP is in a DNS blacklist.
*
* @param $ip \string IP to check
+ * @param $checkWhitelist Boolean: whether to check the whitelist first
* @return \bool True if blacklisted.
*/
- function inSorbsBlacklist( $ip ) {
- global $wgEnableSorbs, $wgSorbsUrl;
+ function isDnsBlacklisted( $ip, $checkWhitelist = false ) {
+ global $wgEnableSorbs, $wgEnableDnsBlacklist,
+ $wgSorbsUrl, $wgDnsBlacklistUrls, $wgProxyWhitelist;
- return $wgEnableSorbs &&
- $this->inDnsBlacklist( $ip, $wgSorbsUrl );
+ if ( !$wgEnableDnsBlacklist && !$wgEnableSorbs )
+ return false;
+
+ if ( $checkWhitelist && in_array( $ip, $wgProxyWhitelist ) )
+ return false;
+
+ $urls = array_merge( $wgDnsBlacklistUrls, (array)$wgSorbsUrl );
+ return $this->inDnsBlacklist( $ip, $urls );
}
/**
*/
function addNewAccountInternal() {
global $wgUser, $wgOut;
- global $wgEnableSorbs, $wgProxyWhitelist;
global $wgMemc, $wgAccountCreationThrottle;
global $wgAuth, $wgMinimalPasswordLength;
global $wgEmailConfirmToEdit;
}
$ip = wfGetIP();
- if ( $wgEnableSorbs && !in_array( $ip, $wgProxyWhitelist ) &&
- $wgUser->inSorbsBlacklist( $ip ) )
- {
+ if ( $wgUser->isDnsBlacklisted( $ip, true /* check $wgProxyWhitelist */ ) ) {
$this->mainLoginForm( wfMsg( 'sorbs_create_account_reason' ) . ' (' . htmlspecialchars( $ip ) . ')' );
return;
}