Exception for function prevent_get_csrf

This commit is contained in:
myvesta 2021-08-29 11:50:22 +02:00 committed by GitHub
commit 834f939fbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,8 +79,13 @@ function prevent_post_csrf ($hard_check=false) {
}
}
function prevent_get_csrf ($hard_check=false) {
function prevent_get_csrf () {
global $login_url;
if (file_exists('/usr/local/vesta/conf_web/dont_check_csrf')) return;
if ($_SERVER['REQUEST_METHOD'] == "GET") {
if (isset($_GET[$login_url])) return;
if ($_SERVER['REQUEST_URI']=="" || $_SERVER['REQUEST_URI']=="/" || $_SERVER['REQUEST_URI']=="/login/" || $_SERVER['REQUEST_URI']=="/list/web/") return;
}
if (isset($_SERVER['HTTP_HOST']) == false) return;
if (isset($_SERVER['SERVER_PORT']) == false) return;
if (isset($_SERVER['HTTP_REFERER']) == false) return;