disabled network access when loading XML documents
This commit is contained in:
parent
c896d71594
commit
47fe725bd4
@ -216,7 +216,7 @@ class XmlFileLoader extends FileLoader
|
|||||||
|
|
||||||
$dom = new \DOMDocument();
|
$dom = new \DOMDocument();
|
||||||
$dom->validateOnParse = true;
|
$dom->validateOnParse = true;
|
||||||
if (!$dom->load($file, defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0)) {
|
if (!$dom->load($file, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
|
||||||
throw new \InvalidArgumentException(implode("\n", $this->getXmlErrors($internalErrors)));
|
throw new \InvalidArgumentException(implode("\n", $this->getXmlErrors($internalErrors)));
|
||||||
}
|
}
|
||||||
$dom->normalizeDocument();
|
$dom->normalizeDocument();
|
||||||
|
@ -155,7 +155,7 @@ class XmlFileLoader extends FileLoader
|
|||||||
|
|
||||||
$dom = new \DOMDocument();
|
$dom = new \DOMDocument();
|
||||||
$dom->validateOnParse = true;
|
$dom->validateOnParse = true;
|
||||||
if (!$dom->load($file, defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0)) {
|
if (!$dom->load($file, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
|
||||||
throw new \InvalidArgumentException(implode("\n", $this->getXmlErrors($internalErrors)));
|
throw new \InvalidArgumentException(implode("\n", $this->getXmlErrors($internalErrors)));
|
||||||
}
|
}
|
||||||
$dom->normalizeDocument();
|
$dom->normalizeDocument();
|
||||||
|
@ -59,7 +59,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
|
|||||||
libxml_clear_errors();
|
libxml_clear_errors();
|
||||||
|
|
||||||
$dom = new \DOMDocument();
|
$dom = new \DOMDocument();
|
||||||
$dom->loadXML($data);
|
$dom->loadXML($data, LIBXML_NONET);
|
||||||
|
|
||||||
libxml_use_internal_errors($internalErrors);
|
libxml_use_internal_errors($internalErrors);
|
||||||
libxml_disable_entity_loader($disableEntities);
|
libxml_disable_entity_loader($disableEntities);
|
||||||
|
@ -60,7 +60,7 @@ class XliffFileLoader implements LoaderInterface
|
|||||||
|
|
||||||
$dom = new \DOMDocument();
|
$dom = new \DOMDocument();
|
||||||
$dom->validateOnParse = true;
|
$dom->validateOnParse = true;
|
||||||
if (!@$dom->load($file, defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0)) {
|
if (!@$dom->load($file, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
|
||||||
throw new \RuntimeException(implode("\n", $this->getXmlErrors($internalErrors)));
|
throw new \RuntimeException(implode("\n", $this->getXmlErrors($internalErrors)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ class XmlFileLoader extends FileLoader
|
|||||||
|
|
||||||
$dom = new \DOMDocument();
|
$dom = new \DOMDocument();
|
||||||
$dom->validateOnParse = true;
|
$dom->validateOnParse = true;
|
||||||
if (!$dom->load($file, defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0)) {
|
if (!$dom->load($file, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
|
||||||
throw new MappingException(implode("\n", $this->getXmlErrors($internalErrors)));
|
throw new MappingException(implode("\n", $this->getXmlErrors($internalErrors)));
|
||||||
}
|
}
|
||||||
if (!$dom->schemaValidate(__DIR__.'/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd')) {
|
if (!$dom->schemaValidate(__DIR__.'/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd')) {
|
||||||
|
Reference in New Issue
Block a user