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
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.')');
}
}
}
......
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