Validate well-formed XML for record content
This commit is contained in:
parent
2dc049a1cf
commit
c0321ab38d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue