From 88c7c6abe35310136024910af4877384df1c1c2d 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 4e87424e55cb4..35540f38e9182 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -164,7 +164,7 @@ public function getToken($tokenId) { 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); }