From: Ruben Rodriguez Date: Thu, 13 Sep 2018 17:36:30 +0000 (-0400) Subject: Disabled blacklisting ipv6, RT#1318914 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=334a8b7da79eb091acc9ff045e81c1a2864f470d;p=trustcommerce.git Disabled blacklisting ipv6, RT#1318914 --- diff --git a/CRM/Core/Payment/TrustCommerce.php b/CRM/Core/Payment/TrustCommerce.php index ac1f36b..1ee3ad8 100644 --- a/CRM/Core/Payment/TrustCommerce.php +++ b/CRM/Core/Payment/TrustCommerce.php @@ -373,6 +373,10 @@ class CRM_Core_Payment_TrustCommerce extends CRM_Core_Payment { // TODO: fix DB calls to be more the CiviCRM way $ip = $_SERVER['REMOTE_ADDR']; $agent = $_SERVER['HTTP_USER_AGENT']; + # Disable on IPv6 + if ( strpos(":", $ip) !== false ){ + return TRUE; + } $ip = ip2long($ip); $blacklist = array(); $dao = CRM_Core_DAO::executeQuery('SELECT * FROM `trustcommerce_blacklist`');