From 3c632f3910eab917a9450efd9fa0e83e02c25c7c Mon Sep 17 00:00:00 2001 From: celestora Date: Mon, 14 Nov 2022 16:22:23 +0200 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=B4=D1=8E=D0=BF?= =?UTF-8?q?=D0=B0=20=D0=B0=D0=BB=D0=BC=D0=B0=D0=B7=D0=BE=D0=B2=20=D0=B2=20?= =?UTF-8?q?=D1=81=D0=BB=D1=83=D0=B6=D0=B5=D0=B1=D0=BD=D0=BE=D0=BC=20=D0=B0?= =?UTF-8?q?=D0=BF=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ServiceAPI/Apps.php | 5 +++++ Web/static/js/al_games.js | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ServiceAPI/Apps.php b/ServiceAPI/Apps.php index 521b117e..6504c23e 100644 --- a/ServiceAPI/Apps.php +++ b/ServiceAPI/Apps.php @@ -54,6 +54,11 @@ class Apps implements Handler $reject("No application with this id found"); return; } + + if($amount < 0) { + $reject(552, "Payment amount is invalid"); + return; + } $coinsLeft = $this->user->getCoins() - $amount; if($coinsLeft < 0) { diff --git a/Web/static/js/al_games.js b/Web/static/js/al_games.js index 78bd738c..63994b83 100644 --- a/Web/static/js/al_games.js +++ b/Web/static/js/al_games.js @@ -142,6 +142,8 @@ function handlePayment(event) { ok: false, error: "negative sum" }, '*'); + + return; } MessageBox(