diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 0d76d4672fdb..86d5069ee7f4 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -652,13 +652,13 @@ protected static function validateSubTypeByEntity($entityType, $subType) { return $subType; } $contactTypes = civicrm_api3('Contact', 'getoptions', array('field' => 'contact_type')); - if ($entityType != 'Contact' && !in_array($entityType, $contactTypes['values'])) { + if ($entityType != 'Contact' && !array_key_exists($entityType, $contactTypes['values'])) { // Not quite sure if we want to fail this hard. But quiet ignore would be pretty bad too. // Am inclined to go with this for RC release & considering softening. throw new CRM_Core_Exception('Invalid Entity Filter'); } $subTypes = civicrm_api3('Contact', 'getoptions', array('field' => 'contact_sub_type')); - if (!isset($subTypes['values'][$subType])) { + if (!array_key_exists($subType, $subTypes['values'])) { // Same comments about fail hard as above. throw new CRM_Core_Exception('Invalid Filter'); }