From f551dba3f3edb2df829ed6ee167793aebee76db6 Mon Sep 17 00:00:00 2001 From: Halil Beycan <50718965+BeycanDeveloper@users.noreply.github.com> Date: Sat, 2 Mar 2024 21:47:23 +0800 Subject: [PATCH] added comment lines --- classes/lite/MeprCryptoPayLiteGateway.php | 3 ++- classes/pro/MeprCryptoPayGateway.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/lite/MeprCryptoPayLiteGateway.php b/classes/lite/MeprCryptoPayLiteGateway.php index 11f8ebc..c03833b 100644 --- a/classes/lite/MeprCryptoPayLiteGateway.php +++ b/classes/lite/MeprCryptoPayLiteGateway.php @@ -236,7 +236,8 @@ private function mepr_invoice_header($txn): void { $order_bumps = []; try { - $orderBumpProductIds = isset($_GET['obs']) && is_array($_GET['obs']) ? array_map('intval', $_GET['obs']) : []; + // obs parameter clearing with absint method with array_map + $orderBumpProductIds = isset($_GET['obs']) && is_array($_GET['obs']) ? array_map('absint', $_GET['obs']) : []; $orderBumpProducts = MeprCheckoutCtrl::get_order_bump_products($txn->product_id, $orderBumpProductIds); foreach ($orderBumpProducts as $product) { diff --git a/classes/pro/MeprCryptoPayGateway.php b/classes/pro/MeprCryptoPayGateway.php index a3fa1c5..5464646 100644 --- a/classes/pro/MeprCryptoPayGateway.php +++ b/classes/pro/MeprCryptoPayGateway.php @@ -226,7 +226,8 @@ private function mepr_invoice_header($txn): void { $order_bumps = []; try { - $orderBumpProductIds = isset($_GET['obs']) && is_array($_GET['obs']) ? array_map('intval', $_GET['obs']) : []; + // obs parameter clearing with absint method with array_map + $orderBumpProductIds = isset($_GET['obs']) && is_array($_GET['obs']) ? array_map('absint', $_GET['obs']) : []; $orderBumpProducts = MeprCheckoutCtrl::get_order_bump_products($txn->product_id, $orderBumpProductIds); foreach ($orderBumpProducts as $product) { @@ -352,7 +353,6 @@ public function display_update_account_form($subscription_id, $errors = array(), $txn->user_id = $usr->ID; $txn->product_id = sanitize_key($prd->ID); - // $txn->set_subtotal($_POST['amount']); //Don't do this, it doesn't work right on existing txns $txn->amount = MeprUtils::format_currency_us_float($sub->price); $txn->tax_amount = MeprUtils::format_currency_us_float($sub->tax_amount); $txn->total = $txn->amount + $txn->tax_amount;