Check validity of resumption token by filemtime

This commit is contained in:
Sebastian Meyer 2017-05-13 12:55:50 +02:00
parent f916082fdc
commit 008d5599c4
1 changed files with 2 additions and 2 deletions

View File

@ -169,10 +169,10 @@ class OAI2Server {
if (count($this->args) > 1) { if (count($this->args) > 1) {
$this->errors[] = new OAI2Exception('badArgument'); $this->errors[] = new OAI2Exception('badArgument');
} else { } else {
if ((int)$this->args['resumptionToken']+$this->token_valid < time()) { if (!file_exists($this->token_prefix.$this->args['resumptionToken'])) {
$this->errors[] = new OAI2Exception('badResumptionToken'); $this->errors[] = new OAI2Exception('badResumptionToken');
} else { } 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'); $this->errors[] = new OAI2Exception('badResumptionToken');
} else { } else {
if ($readings = $this->readResumptionToken($this->token_prefix.$this->args['resumptionToken'])) { if ($readings = $this->readResumptionToken($this->token_prefix.$this->args['resumptionToken'])) {