Skip to content
Snippets Groups Projects
Commit 16a65ee0 authored by Dorian Merz's avatar Dorian Merz Committed by Robert Lange
Browse files

refs #18611 [finc] EZB resolver call: remove date if in wrong format

parent b5673b6b
No related merge requests found
...@@ -115,6 +115,15 @@ class Ezb extends AbstractBase implements TranslatorAwareInterface ...@@ -115,6 +115,15 @@ class Ezb extends AbstractBase implements TranslatorAwareInterface
$parsed[$tmp2[0]] = $tmp2[1]; $parsed[$tmp2[0]] = $tmp2[1];
} }
// resolver only accepts date formats YYYY, YYYY-MM, and YYYY-MM-DD
// in case we have a date in another format, drop the date information
if (
isset($parsed['rft.date'])
&& !preg_match('/^\d{4}(-\d\d(-\d\d)?)?$/',$parsed['rft.date'])
) {
unset($parsed['rft.date']);
}
// Downgrade 1.0 to 0.1 // Downgrade 1.0 to 0.1
if ($parsed['ctx_ver'] == 'Z39.88-2004') { if ($parsed['ctx_ver'] == 'Z39.88-2004') {
$openURL = $this->downgradeOpenUrl($parsed); $openURL = $this->downgradeOpenUrl($parsed);
......
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