From 48ffcea204de720201493334acd04e123173b68e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 8 Aug 2023 16:50:56 +0800 Subject: [PATCH] 1 --- webapp/controller/MallController.class.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/webapp/controller/MallController.class.php b/webapp/controller/MallController.class.php index 559ce8f6..774e38a8 100644 --- a/webapp/controller/MallController.class.php +++ b/webapp/controller/MallController.class.php @@ -120,28 +120,20 @@ class MallController extends BaseAuthedController { return; } $itemId = getReqVal('item_id', ''); - $amount = getReqVal('amount', ''); + $amount = intval(getReqVal('amount', ''), 10); $currency = getReqVal('currency', ''); $priceBn = phpcommon\bnInit(getReqVal('price', '')); if ($itemId != V_ITEM_GOLD) { $this->_rspErr(1, 'only support gold'); return; } - if (!$this->checkPrice($priceBn)) { - return; - } - if (empty($amount)) { - $this->_rspErr(1, 'amount not found'); - return; - } - if (!is_numeric($amount)) { - $this->_rspErr(1, 'amount must be number'); - return; - } if ($amount <= 0) { $this->_rspErr(1, 'amount must > 0'); return; } + if (!$this->checkPrice($priceBn)) { + return; + } if (!in_array( $currency, array(