X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FCustomGroup.php;h=6653d6b4f7fb8770d7c294227dc5cc1382b37785;hb=6bbc383dc4c9070079986235fa145cafc3c72eeb;hp=2e88e0801455fa4037acd57c35c34dc5621987a9;hpb=37f058e60a90cf2cd91e000bf09a58fde2c9def3;p=civicrm-core.git diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 2e88e08014..6653d6b4f7 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1259,6 +1259,10 @@ ORDER BY civicrm_custom_group.weight, */ private static function _addWhereAdd(&$customGroupDAO, $entityType, $entityID = NULL, $allSubtypes = FALSE) { $addSubtypeClause = FALSE; + // This function isn't really accessible with user data but since the string + // is not passed as a param to the query CRM_Core_DAO::escapeString seems like a harmless + // precaution. + $entityType = CRM_Core_DAO::escapeString($entityType); switch ($entityType) { case 'Contact': @@ -1281,13 +1285,7 @@ ORDER BY civicrm_custom_group.weight, } break; - case 'Case': - case 'Location': - case 'Address': - case 'Activity': - case 'Contribution': - case 'Membership': - case 'Participant': + default: $customGroupDAO->whereAdd("extends IN ('$entityType')"); break; } @@ -1961,7 +1959,7 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1, /** * Build custom data view. * - * @param CRM_Core_Form $form + * @param CRM_Core_Form|CRM_Core_Page $form * Page object. * @param array $groupTree * @param bool $returnCount @@ -1972,6 +1970,7 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1, * @param int $entityId * * @return array|int + * @throws \Exception */ public static function buildCustomDataView(&$form, &$groupTree, $returnCount = FALSE, $gID = NULL, $prefix = NULL, $customValueId = NULL, $entityId = NULL) { $details = array();