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

:ambulance: fix(core) Use FusionDirectoryException instead of Exception

issue #5840
Showing with 3 additions and 3 deletions
+3 -3
...@@ -26,13 +26,13 @@ class CSRFProtection ...@@ -26,13 +26,13 @@ class CSRFProtection
return; return;
} }
if (empty($_POST['CSRFtoken'])) { if (empty($_POST['CSRFtoken'])) {
throw new Exception('CSRF protection token missing'); throw new FusionDirectoryException('CSRF protection token missing');
} }
static::checkHeaders(); static::checkHeaders();
if ($_POST['CSRFtoken'] !== static::getToken()) { 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 ...@@ -63,7 +63,7 @@ class CSRFProtection
} }
if ($target) { if ($target) {
if (!hash_equals($origin, $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

    • :warning: 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. :warning: Merge this if statement with the enclosing one. :blue_book:

    By Ghost User on 2018-06-04T14:54:48 (imported from GitLab)

  • bmortier @bmortier

    mentioned in commit 62ffce88

    By Côme Chilliet on 2018-06-13T12:46:14 (imported from GitLab)

    ·

    mentioned in commit 62ffce88

    By Côme Chilliet on 2018-06-13T12:46:14 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in merge request !296

    By Côme Chilliet on 2018-06-13T12:46:41 (imported from GitLab)

    ·

    mentioned in merge request !296

    By Côme Chilliet on 2018-06-13T12:46:41 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in commit fd690297

    By Côme Chilliet on 2018-06-13T13:13:59 (imported from GitLab)

    ·

    mentioned in commit fd690297

    By Côme Chilliet on 2018-06-13T13:13:59 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in merge request !298

    By Côme Chilliet on 2018-06-13T13:14:20 (imported from GitLab)

    ·

    mentioned in merge request !298

    By Côme Chilliet on 2018-06-13T13:14:20 (imported from GitLab)

    Toggle commit list
Supports Markdown
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