From 008d5599c4f3afa3cf063409646cccfeed48d118 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Sat, 13 May 2017 12:55:50 +0200 Subject: [PATCH] Check validity of resumption token by filemtime --- oai2server.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oai2server.php b/oai2server.php index ada10f6..7ca7017 100644 --- a/oai2server.php +++ b/oai2server.php @@ -169,10 +169,10 @@ class OAI2Server { if (count($this->args) > 1) { $this->errors[] = new OAI2Exception('badArgument'); } else { - if ((int)$this->args['resumptionToken']+$this->token_valid < time()) { + if (!file_exists($this->token_prefix.$this->args['resumptionToken'])) { $this->errors[] = new OAI2Exception('badResumptionToken'); } else { - if (!file_exists($this->token_prefix.$this->args['resumptionToken'])) { + if (filemtime($this->token_prefix.$this->args['resumptionToken'])+$this->token_valid < time()) { $this->errors[] = new OAI2Exception('badResumptionToken'); } else { if ($readings = $this->readResumptionToken($this->token_prefix.$this->args['resumptionToken'])) {