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

@ -7,10 +7,9 @@ session_start();
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check token
// if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
// header('location: /login/');
// exit();
// }
if ((!isset($_REQUEST['token'])) || ($_SESSION['token'] != $_REQUEST['token'])) {
die("Wrong token");
}
// Protect input
$v_section = escapeshellarg($_REQUEST['v_section']);