From: Alexander Ebert Date: Wed, 11 Feb 2015 15:19:41 +0000 (+0100) Subject: Fixed check against IP blacklist (both IPv4 and IPv6) X-Git-Tag: 2.1.0_RC_1~6^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dc0015abe059b7d563843a68fbcc6f1e923ec1c2;p=GitHub%2FWoltLab%2FWCF.git Fixed check against IP blacklist (both IPv4 and IPv6) --- diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 4f6d0c6891..032b57776b 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -27,6 +27,7 @@ use wcf\util\ArrayUtil; use wcf\util\ClassUtil; use wcf\util\FileUtil; use wcf\util\StringUtil; +use wcf\util\UserUtil; // try to set a time-limit to infinite @set_time_limit(0); @@ -37,7 +38,7 @@ if (!@ini_get('date.timezone')) { } // define current wcf version -define('WCF_VERSION', '2.0.10 pl 2 (Maelstrom)'); +define('WCF_VERSION', '2.0.11 (Maelstrom)'); // define current unix timestamp define('TIME_NOW', time()); @@ -385,7 +386,10 @@ class WCF { */ protected function initBlacklist() { if (defined('BLACKLIST_IP_ADDRESSES') && BLACKLIST_IP_ADDRESSES != '') { - if (!StringUtil::executeWordFilter(self::getSession()->ipAddress, BLACKLIST_IP_ADDRESSES)) { + if (!StringUtil::executeWordFilter(UserUtil::convertIPv6To4(self::getSession()->ipAddress), BLACKLIST_IP_ADDRESSES)) { + throw new PermissionDeniedException(); + } + else if (!StringUtil::executeWordFilter(self::getSession()->ipAddress, BLACKLIST_IP_ADDRESSES)) { throw new PermissionDeniedException(); } }