mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
Preventing CSRF in UploadHandler.php
This commit is contained in:
parent
c2a30bcd31
commit
92297f2fc2
1 changed files with 2 additions and 7 deletions
|
@ -2,13 +2,8 @@
|
|||
|
||||
//session_start();
|
||||
|
||||
$host_arr=explode(":", $_SERVER['HTTP_HOST']);
|
||||
$hostname=$host_arr[0];
|
||||
$port = $_SERVER['SERVER_PORT'];
|
||||
$expected_http_origin="https://".$hostname.":".$port;
|
||||
if ($_SERVER['HTTP_ORIGIN'] != $expected_http_origin) {
|
||||
die ("Nope.");
|
||||
}
|
||||
// Preventing CSRF
|
||||
prevent_post_csrf(true);
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue