From a51abc7ec648065e7da0a10407a2d946d3b75855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludv=C3=ADk=20Prokopec?= Date: Fri, 2 Sep 2022 16:22:39 +0200 Subject: [PATCH] prevent unset --- api/routes/game/details.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/routes/game/details.php b/api/routes/game/details.php index 809da2d..0dd5d69 100644 --- a/api/routes/game/details.php +++ b/api/routes/game/details.php @@ -31,6 +31,10 @@ return [ "post" => function($data, $headers, $db) { $imagesHostName = 'https://geohry.skolazdola.cz/'; + if(!isset($data['gameurl']) || empty($data['gameurl'])) return [ + "error" => "Property 'gameurl' is not set." + ]; + $gameUrl = $data['gameurl']; $gameDetails = $db->select('games4', '*', [