CRM-14106 - Regex targeting the first part of if statements
[civicrm-core.git] / CRM / Contact / BAO / GroupContact.php
index 1d792ec283f29b761328c720382eb108762d244d..7043d6a2094971ffe5a857b0822d59d08b02b6b7 100644 (file)
@@ -535,11 +535,11 @@ SELECT    *
 
     // check which values has to be add/remove contact from group
     foreach ($allGroup as $key => $varValue) {
-      if (CRM_Utils_Array::value($key, $params) && !array_key_exists($key, $contactGroup)) {
+      if (!empty($params[$key]) && !array_key_exists($key, $contactGroup)) {
         // add contact to group
         CRM_Contact_BAO_GroupContact::addContactsToGroup($contactIds, $key, $method);
       }
-      elseif (!CRM_Utils_Array::value($key, $params) && array_key_exists($key, $contactGroup)) {
+      elseif (empty($params[$key]) && array_key_exists($key, $contactGroup)) {
         // remove contact from group
         CRM_Contact_BAO_GroupContact::removeContactsFromGroup($contactIds, $key, $method);
       }