mirror of
https://github.com/myvesta/vesta
synced 2025-07-06 13:01:56 -07:00
Update index.php
This commit is contained in:
parent
9f55ef33cf
commit
518e627b46
1 changed files with 8 additions and 6 deletions
|
@ -1,12 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Preventing CSRF
|
// Preventing CSRF
|
||||||
$host_arr=explode(":", $_SERVER['HTTP_HOST']);
|
if ($_SERVER['REQUEST_METHOD']=='POST') {
|
||||||
$hostname=$host_arr[0];
|
$host_arr=explode(":", $_SERVER['HTTP_HOST']);
|
||||||
$port = $_SERVER['SERVER_PORT'];
|
$hostname=$host_arr[0];
|
||||||
$expected_http_origin="https://".$hostname.":".$port;
|
$port = $_SERVER['SERVER_PORT'];
|
||||||
if ($_SERVER['HTTP_ORIGIN'] != $expected_http_origin) {
|
$expected_http_origin="https://".$hostname.":".$port;
|
||||||
die ("Nope.");
|
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