From 3b51b48cee3cb2d3d5021eb50acd7f14c4ef9855 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be>
Date: Mon, 4 Jun 2018 16:45:16 +0200
Subject: [PATCH] :ambulance: fix(core) Use FusionDirectoryException instead of
 Exception

issue #5840
---
 include/class_CSRFProtection.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/class_CSRFProtection.inc b/include/class_CSRFProtection.inc
index cfa60da00..dec9a5b17 100644
--- a/include/class_CSRFProtection.inc
+++ b/include/class_CSRFProtection.inc
@@ -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.')');
         }
       }
     }
-- 
GitLab