From 4bbcdd190a581df14d0d83ee18450a35606fcdcb Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Fri, 22 Dec 2017 09:46:36 +0100 Subject: [PATCH] Prevent PHP notices --- oai2server.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oai2server.php b/oai2server.php index 102cfd1..0f92dc6 100644 --- a/oai2server.php +++ b/oai2server.php @@ -156,7 +156,7 @@ class OAI2Server { public function ListRecords() { $maxItems = $this->max_records; $deliveredRecords = 0; - $metadataPrefix = $this->args['metadataPrefix']; + $metadataPrefix = isset($this->args['metadataPrefix']) ? $this->args['metadataPrefix'] : ''; $from = isset($this->args['from']) ? $this->args['from'] : ''; $until = isset($this->args['until']) ? $this->args['until'] : ''; if (isset($this->args['resumptionToken'])) { @@ -207,6 +207,7 @@ class OAI2Server { } $records = call_user_func($this->listRecordsCallback, $metadataPrefix, $this->formatTimestamp($from), $this->formatTimestamp($until), false, $deliveredRecords, $maxItems); foreach ($records as $record) { + $cur_record = null; if ($this->verb == 'ListRecords') { // for ListIdentifiers, only headers will be returned. $cur_record = $this->response->addToVerbNode('record'); }