Checking token on adding and deleting favorites

This commit is contained in:
myvesta 2021-08-29 16:05:33 +02:00
commit 475fe47984
3 changed files with 11 additions and 6 deletions

View file

@ -5,6 +5,11 @@
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check token
if ((!isset($_REQUEST['token'])) || ($_SESSION['token'] != $_REQUEST['token'])) {
die("Wrong token");
}
unset($_SESSION['favourites'][strtoupper($_REQUEST['v_section'])][$_REQUEST['v_unit_id']]);
$v_section = escapeshellarg($_REQUEST['v_section']);