Skip to content

Commit

Permalink
Initialize errors variables used in MetadataUtils::loadXML() calls (#147
Browse files Browse the repository at this point in the history
)
  • Loading branch information
aleksip authored Oct 25, 2023
1 parent c9cb65f commit c918e6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/RecordManager/Base/Controller/CreatePreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public function launch($metadata, $format, $source)

if ('marc' !== $format && substr(trim($metadata), 0, 1) === '<') {
$doc = new \DOMDocument();
$errors = '';
if (false === $this->metadataUtils->loadXML($metadata, $doc, 0, $errors)) {
throw new \Exception("Could not parse XML record: $errors");
}
Expand Down Expand Up @@ -244,6 +245,7 @@ public function getDataSources($format = '')
protected function oaipmhTransform($metadata, $transformations)
{
$doc = new \DOMDocument();
$errors = '';
if (false === $this->metadataUtils->loadXML($metadata, $doc, 0, $errors)) {
throw new \Exception("Could not parse XML record: $errors");
}
Expand Down

0 comments on commit c918e6d

Please sign in to comment.