mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 13:54:26 -07:00
Fix for an boring PHP Notice in vesta-php
This commit is contained in:
parent
d625c9722a
commit
bc67f1028a
1 changed files with 1 additions and 4 deletions
|
@ -63,8 +63,7 @@ function prevent_post_csrf ($hard_check=false) {
|
||||||
if (isset($_SERVER['HTTP_ORIGIN']) == false) $_SERVER['HTTP_ORIGIN'] = '';
|
if (isset($_SERVER['HTTP_ORIGIN']) == false) $_SERVER['HTTP_ORIGIN'] = '';
|
||||||
}
|
}
|
||||||
$_SERVER['HTTP_HOST'] = strtolower($_SERVER['HTTP_HOST']);
|
$_SERVER['HTTP_HOST'] = strtolower($_SERVER['HTTP_HOST']);
|
||||||
if (isset($_SERVER['HTTP_ORIGIN'])) $_SERVER['HTTP_ORIGIN'] = strtolower($_SERVER['HTTP_ORIGIN']);
|
$_SERVER['HTTP_ORIGIN'] = strtolower($_SERVER['HTTP_ORIGIN']);
|
||||||
else $_SERVER['HTTP_ORIGIN']='';
|
|
||||||
if ($hard_check == false) {
|
if ($hard_check == false) {
|
||||||
if (substr($_SERVER['HTTP_ORIGIN'], 0, 8) != "file:///" && substr($_SERVER['HTTP_ORIGIN'], 0, 7) != "http://" && substr($_SERVER['HTTP_ORIGIN'], 0, 8) != "https://") return;
|
if (substr($_SERVER['HTTP_ORIGIN'], 0, 8) != "file:///" && substr($_SERVER['HTTP_ORIGIN'], 0, 7) != "http://" && substr($_SERVER['HTTP_ORIGIN'], 0, 8) != "https://") return;
|
||||||
}
|
}
|
||||||
|
@ -92,8 +91,6 @@ function prevent_get_csrf () {
|
||||||
if (isset($_SERVER['SERVER_PORT']) == false) return;
|
if (isset($_SERVER['SERVER_PORT']) == false) return;
|
||||||
if (isset($_SERVER['HTTP_REFERER']) == false) return;
|
if (isset($_SERVER['HTTP_REFERER']) == false) return;
|
||||||
$_SERVER['HTTP_HOST'] = strtolower($_SERVER['HTTP_HOST']);
|
$_SERVER['HTTP_HOST'] = strtolower($_SERVER['HTTP_HOST']);
|
||||||
if (isset($_SERVER['HTTP_ORIGIN'])) $_SERVER['HTTP_ORIGIN'] = strtolower($_SERVER['HTTP_ORIGIN']);
|
|
||||||
else $_SERVER['HTTP_ORIGIN']='';
|
|
||||||
if (substr($_SERVER['HTTP_REFERER'], 0, 8) != "file:///" && substr($_SERVER['HTTP_REFERER'], 0, 7) != "http://" && substr($_SERVER['HTTP_REFERER'], 0, 8) != "https://") return;
|
if (substr($_SERVER['HTTP_REFERER'], 0, 8) != "file:///" && substr($_SERVER['HTTP_REFERER'], 0, 7) != "http://" && substr($_SERVER['HTTP_REFERER'], 0, 8) != "https://") return;
|
||||||
$host_arr = explode(":", $_SERVER['HTTP_HOST']);
|
$host_arr = explode(":", $_SERVER['HTTP_HOST']);
|
||||||
$hostname = $host_arr[0];
|
$hostname = $host_arr[0];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue