From c0321ab38d7647d6c0d87410cd3a1aef2b44fda0 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 8 Jan 2024 19:47:48 +0100 Subject: [PATCH] Validate well-formed XML for record content --- src/Database/Record.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 @@ class Record $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;