diff --git a/src/Database/Record.php b/src/Database/Record.php index 093cca2..6840ab1 100644 --- a/src/Database/Record.php +++ b/src/Database/Record.php @@ -249,11 +249,11 @@ protected function validate(string $xml): string $xml, [ new Assert\Type('string'), - // TODO: Validate well-formed XML. new Assert\NotBlank() ] ); - if ($violations->count() > 0) { + if ($violations->count() > 0 + or simplexml_load_string($xml) === false) { throw new ValidationFailedException(null, $violations); } return $xml;