Skip to content

Commit fa66aa1

Browse files
author
Oleksii Korshenko
authored
MAGETWO-85992: Throw ValidationException for invalid xml magento#12859
2 parents b3e510c + eade8fd commit fa66aa1

File tree

1 file changed

+7
-1
lines changed
  • app/code/Magento/Config/Model/Config/Structure

1 file changed

+7
-1
lines changed

app/code/Magento/Config/Model/Config/Structure/Reader.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,20 @@ protected function _readFiles($fileList)
124124
* Processing nodes of the document before merging
125125
*
126126
* @param string $content
127+
* @throws \Magento\Framework\Config\Dom\ValidationException
127128
* @return string
128129
*/
129130
protected function processingDocument($content)
130131
{
131132
$object = new DataObject();
132133
$document = new \DOMDocument();
133134

134-
$document->loadXML($content);
135+
try {
136+
$document->loadXML($content);
137+
} catch (\Exception $e) {
138+
throw new \Magento\Framework\Config\Dom\ValidationException($e->getMessage());
139+
}
140+
135141
$this->compiler->compile($document->documentElement, $object, $object);
136142

137143
return $document->saveXML();

0 commit comments

Comments
 (0)