mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Return a 404 http code when CSRF protection fails
This commit is contained in:
parent
69266ae61f
commit
4a343247b0
|
|
@ -510,6 +510,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
|
|||
print $langs->trans("ErrorGoBackAndCorrectParameters");
|
||||
die;
|
||||
} else {
|
||||
http_response_code(403);
|
||||
if (defined('CSRFCHECK_WITH_TOKEN')) {
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (CSRFCHECK_WITH_TOKEN protection) in main.inc.php. Token not provided.", LOG_WARNING);
|
||||
print "Access to a page that needs a token (constant CSRFCHECK_WITH_TOKEN is defined) is refused by CSRF protection in main.inc.php. Token not provided.\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user