2 => array($tag_name, 'String'),
);
CRM_Core_DAO::executeQuery($sql, $params);
-
- // set permanent cookie to indicate this users email address now confirmed
- setcookie("confirmed_{$petition_id}",
- $activity_id,
- time() + $this->cookieExpire,
- '/'
- );
-
- return TRUE;
+ // validate arguments to setcookie are numeric to prevent header manipulation
+ if (isset($petition_id) && is_numeric($petition_id)
+ && isset($activity_id) && is_numeric($activity_id)) {
+ // set permanent cookie to indicate this users email address now confirmed
+ setcookie("confirmed_{$petition_id}",
+ $activity_id,
+ time() + $this->cookieExpire,
+ '/'
+ );
+ return TRUE;
+ }
+ else {
+ // TODO: raise an error?
+ return FALSE;
+ }
}
/**