mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 13:01:52 -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();
|
//session_start();
|
||||||
|
|
||||||
$host_arr=explode(":", $_SERVER['HTTP_HOST']);
|
// Preventing CSRF
|
||||||
$hostname=$host_arr[0];
|
prevent_post_csrf(true);
|
||||||
$port = $_SERVER['SERVER_PORT'];
|
|
||||||
$expected_http_origin="https://".$hostname.":".$port;
|
|
||||||
if ($_SERVER['HTTP_ORIGIN'] != $expected_http_origin) {
|
|
||||||
die ("Nope.");
|
|
||||||
}
|
|
||||||
|
|
||||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue