From c31109f18ada47f3c9b2da6a5bd4172571c7e885 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 22 Oct 2014 11:01:45 +1300 Subject: [PATCH] CRM-15510 param retrieval issue Conflicts: CRM/Event/Page/AJAX.php --- CRM/Event/Cart/Page/CheckoutAJAX.php | 10 +++++----- CRM/Event/Page/AJAX.php | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CRM/Event/Cart/Page/CheckoutAJAX.php b/CRM/Event/Cart/Page/CheckoutAJAX.php index bef47d294f..8b8bc27503 100644 --- a/CRM/Event/Cart/Page/CheckoutAJAX.php +++ b/CRM/Event/Cart/Page/CheckoutAJAX.php @@ -5,12 +5,11 @@ */ class CRM_Event_Cart_Page_CheckoutAJAX { function add_participant_to_cart() { - require 'CRM/Core/Transaction.php'; $transaction = new CRM_Core_Transaction(); - $cart_id = $_GET['cart_id']; - $event_id = $_GET['event_id']; + $cart_id = CRM_Utils_Request::retrieve('cart_id', 'Integer'); + $event_id = CRM_Utils_Request::retrieve('event_id', 'Integer'); - $cart = CRM_Event_Cart_BAO_Cart::find_by_id($_GET['cart_id']); + $cart = CRM_Event_Cart_BAO_Cart::find_by_id($cart_id); $params_array = array('cart_id' => $cart->id, 'contact_id' => CRM_Event_Cart_Form_Cart::find_or_create_contact(), 'event_id' => $event_id); @@ -43,7 +42,8 @@ class CRM_Event_Cart_Page_CheckoutAJAX { } function remove_participant_from_cart() { - $participant = CRM_Event_Cart_BAO_MerParticipant::get_by_id($_GET['id']); + $id = CRM_Utils_Request::retrieve('id', 'Integer'); + $participant = CRM_Event_Cart_BAO_MerParticipant::get_by_id($id); $participant->delete(); CRM_Utils_System::civiExit(); diff --git a/CRM/Event/Page/AJAX.php b/CRM/Event/Page/AJAX.php index 5302013271..24d05da96a 100644 --- a/CRM/Event/Page/AJAX.php +++ b/CRM/Event/Page/AJAX.php @@ -66,6 +66,5 @@ GROUP BY cv.label"; } CRM_Utils_JSON::output($results); } - } -- 2.25.1