From a5a272e5d4f1dd11295ecef3c2c8c6724eee29df Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 8 Jun 2018 16:20:43 +0200 Subject: 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 eee4db20af9..dd7829cc68c 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -159,7 +159,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); } -- cgit v1.2.3