$id = CRM_Utils_Type::escape($_REQUEST['id'], 'Integer');
}
- if (!empty($_REQUEST['context'])) {
- $context = CRM_Utils_Type::escape($_REQUEST['context'], 'String');
- }
+ $context = CRM_Utils_Request::retrieve('context', 'Alphanumeric');
+
// return false if $id is null and
// $context is not civicrm_event or civicrm_contribution_page
if (!$id || !in_array($context, array('civicrm_event', 'civicrm_contribution_page'))) {