From 31798a6b536069bc47832545b036c0d62422400c Mon Sep 17 00:00:00 2001 From: flashwave Date: Tue, 11 Jul 2023 22:11:56 +0000 Subject: [PATCH] Change CSRFP epoch and check if token is empty. --- VERSION | 2 +- src/Security/CSRFP.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index f5eb630..402900e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2307.112200 +0.2307.112211 diff --git a/src/Security/CSRFP.php b/src/Security/CSRFP.php index b2ac4c6..3addb56 100644 --- a/src/Security/CSRFP.php +++ b/src/Security/CSRFP.php @@ -12,7 +12,7 @@ use Index\Serialisation\Serialiser; */ class CSRFP { private const TOLERANCE = 30 * 60; - private const EPOCH = 1682985600; + private const EPOCH = 1575158400; private const HASH_ALGO = 'sha3-256'; private const TIMESTAMP_LENGTH = 4; @@ -74,7 +74,7 @@ class CSRFP { * @return bool true if the token is valid, false if not. */ public function verifyToken(string $token, int $tolerance = -1, int $time = -1): bool { - if($tolerance === 0) + if($tolerance === 0 || empty($token)) return false; if($tolerance < 0) $tolerance = $this->tolerance;