From cfc5b55074b9ac3fc919a7aff7dce3cb9d3a6693 Mon Sep 17 00:00:00 2001 From: neerholt Date: Tue, 9 Mar 2021 13:30:21 +0100 Subject: [PATCH] add token on upload --- Backend/Controllers/FileHandler/upload.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Backend/Controllers/FileHandler/upload.php b/Backend/Controllers/FileHandler/upload.php index 0adc277..ce07679 100644 --- a/Backend/Controllers/FileHandler/upload.php +++ b/Backend/Controllers/FileHandler/upload.php @@ -4,6 +4,10 @@ use Backend\Models\GameData; $isImages = false; +session_start(); + +if(isset($_SESSION['token'])){ + if(isset($_POST['submitUpload'])){ //Get the data from the user form $gameFile = $_FILES['gameFile']; @@ -46,7 +50,6 @@ if(isset($_POST['submitUpload'])){ header("location: ../../../Frontend/index.php?error=emptyFile"); exit(); }else{ - $gameData = new GameData(); $gameData->game_name = $title; $gameData->game_link = $gameFileNewName; @@ -68,4 +71,6 @@ if(isset($_POST['submitUpload'])){ echo "Wrong file type"; } +} + } \ No newline at end of file