Disabled blacklisting ipv6, RT#1318914
authorRuben Rodriguez <ruben@fsf.org>
Thu, 13 Sep 2018 17:36:30 +0000 (13:36 -0400)
committerRuben Rodriguez <ruben@fsf.org>
Thu, 13 Sep 2018 17:36:30 +0000 (13:36 -0400)
CRM/Core/Payment/TrustCommerce.php

index ac1f36bf434599d83790938aa824dc85e1b2e871..1ee3ad831b2e96d59ec49de2dad4c681fbbddf53 100644 (file)
@@ -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`');