mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-11-03 19:08:50 +03:00
Force token for #892
This commit is contained in:
parent
977dc1e5e4
commit
b1c9bebce6
4 changed files with 3 additions and 11 deletions
|
|
@ -92,11 +92,8 @@ class ServiceActions
|
|||
throw new Exceptions\ClientException(Notifications::InvalidInputArgument, null, 'Action unknown');
|
||||
}
|
||||
|
||||
if ($this->oHttp->IsPost() &&
|
||||
$this->Config()->Get('security', 'csrf_protection', true) &&
|
||||
($_POST['XToken'] ?? '') !== Utils::GetCsrfToken())
|
||||
{
|
||||
throw new Exceptions\ClientException(Notifications::InvalidToken, null, 'CSRF failed');
|
||||
if ($this->oHttp->IsPost() && ($_POST['XToken'] ?? '') !== Utils::GetCsrfToken()) {
|
||||
throw new Exceptions\ClientException(Notifications::InvalidToken, null, 'Token mismatch');
|
||||
}
|
||||
|
||||
if ($this->oActions instanceof ActionsAdmin && 0 === \stripos($sAction, 'Admin') && !\in_array($sAction, ['AdminLogin', 'AdminLogout'])) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue