From 480864b3e32d88361b17b70d238f986f64579757 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 8 Jun 2018 16:20:43 +0200 Subject: [PATCH] Make the token expiration also work for autocasting 0 Some bad databases don't respect the default null apprently. Now even if they cast it to 0 it should work just fine. Signed-off-by: Roeland Jago Douma --- lib/private/Authentication/Token/DefaultTokenProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php index 5df74cadac..7a43dbb23e 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -171,7 +171,7 @@ class DefaultTokenProvider implements IProvider { throw new InvalidTokenException(); } - if ($token->getExpires() !== null && $token->getExpires() < $this->time->getTime()) { + if ((int)$token->getExpires() !== 0 && $token->getExpires() < $this->time->getTime()) { throw new ExpiredTokenException($token); }