Skip to content
Snippets Groups Projects
Commit cc4f850a authored by Vít Novotný's avatar Vít Novotný Committed by Demian Katz
Browse files

Aleph driver: add extra sanity checks to parseId

parent f4db0d1e
No related merge requests found
......@@ -575,10 +575,17 @@ class Aleph extends AbstractBase implements \Zend\Log\LoggerAwareInterface,
protected function parseId($id)
{
if (count($this->bib) == 1) {
return [$this->bib[0], $id];
$retval = [$this->bib[0], $id];
} else {
return explode('-', $id);
$retval = explode('-', $id);
}
if (count($retval) != 2) {
throw new \Exception("The resulting array has incorrect size");
}
if (!in_array($retval[0], $this->bib)) {
throw new \Exception("The resulting array contains unknown library ID");
}
return $retval;
}
/**
......
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