Skip to content
Snippets Groups Projects
Commit 8f688563 authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

OAI-PMH bug fixes

- Fixed an invalid exception raised when only set_query sets were defined.
- Fixed a PHP notice about accessing uninitialized array key.
parent 93dacf04
Branches
Tags
No related merge requests found
...@@ -776,7 +776,9 @@ class Server ...@@ -776,7 +776,9 @@ class Server
// Set default date range if not already provided: // Set default date range if not already provided:
if (empty($params['from'])) { if (empty($params['from'])) {
$params['from'] = $this->earliestDatestamp; $params['from'] = $this->earliestDatestamp;
if (strlen($params['from']) > strlen($params['until'])) { if (!empty($params['until'])
&& strlen($params['from']) > strlen($params['until'])
) {
$params['from'] = substr($params['from'], 0, 10); $params['from'] = substr($params['from'], 0, 10);
} }
} }
...@@ -793,7 +795,7 @@ class Server ...@@ -793,7 +795,7 @@ class Server
// If no set field is configured and a set parameter comes in, we have a // If no set field is configured and a set parameter comes in, we have a
// problem: // problem:
if (is_null($this->setField) && isset($params['set']) if (null === $this->setField && empty($this->setQueries)
&& !empty($params['set']) && !empty($params['set'])
) { ) {
throw new \Exception('noSetHierarchy:Sets not supported'); throw new \Exception('noSetHierarchy:Sets not supported');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment