From 5f49609a28635abd864b012df029e44a3b3d2359 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 28 Jun 2016 07:18:15 +0000 Subject: [PATCH] csrf : add the exceptions code to Exceptions git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2779 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- csrf.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csrf.php b/csrf.php index 1cfd0e4..735ba7c 100644 --- a/csrf.php +++ b/csrf.php @@ -43,18 +43,18 @@ class csrf if (! isset ($_SESSION["domframework"]["csrf"]["csrf"])) { throw new Exception (dgettext("domframework", - "No previous CSRF token : abort")); + "No previous CSRF token : abort"), 406); } if ($_SESSION["domframework"]["csrf"]["csrf"] !== $tokenFromUser) { throw new Exception (dgettext("domframework", - "Invalid CSRF token provided")); + "Invalid CSRF token provided"), 406); } if (($_SESSION["domframework"]["csrf"]["csrfStart"] + $this->csrfTimeout) < microtime (TRUE)) { throw new Exception (dgettext("domframework", - "Obsolete CSRF token provided")); + "Obsolete CSRF token provided"), 406); } return TRUE; }