Commit 3b51b48c authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚑 fix(core) Use FusionDirectoryException instead of Exception

issue #5840
parent d9089973
......@@ -26,13 +26,13 @@ class CSRFProtection
return;
}
if (empty($_POST['CSRFtoken'])) {
throw new Exception('CSRF protection token missing');
throw new FusionDirectoryException('CSRF protection token missing');
}
static::checkHeaders();
if ($_POST['CSRFtoken'] !== static::getToken()) {
throw new Exception('CSRF protection token invalid');
throw new FusionDirectoryException('CSRF protection token invalid');
}
}
......@@ -63,7 +63,7 @@ class CSRFProtection
}
if ($target) {
if (!hash_equals($origin, $target)) {
throw new Exception('CSRF detected: origin and target are not matching ('.$origin.' != '.$target.')');
throw new FusionDirectoryException('CSRF detected: origin and target are not matching ('.$origin.' != '.$target.')');
}
}
}
......
  • SonarQube analysis reported 1 issue

    • 1 major

    Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:

    1. Merge this if statement with the enclosing one. 📘
  • mentioned in commit 62ffce88

    Toggle commit list
  • mentioned in commit fd690297

    Toggle commit list
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment