diff --git a/module/VuFind/src/VuFind/ILS/Driver/Aleph.php b/module/VuFind/src/VuFind/ILS/Driver/Aleph.php index 52abb9f9f17d180761af5ba2eec05b4c2547ddf7..6daf4f34474cd473de2366538bbd26dd5913e1a6 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Aleph.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Aleph.php @@ -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; } /**