Check validity of resumption token by filemtime
This commit is contained in:
parent
f916082fdc
commit
008d5599c4
|
@ -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'])) {
|
||||||
|
|
Loading…
Reference in New Issue