diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 0722920a6f79..8ce1289fae26 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -52,6 +52,9 @@ public static function retrieve(&$params, &$defaults) { * @param int $id Group id. */ public static function discard($id) { + if (!$id || !is_numeric($id)) { + throw new CRM_Core_Exception('Invalid group request attempted'); + } CRM_Utils_Hook::pre('delete', 'Group', $id, CRM_Core_DAO::$_nullArray); $transaction = new CRM_Core_Transaction();