disable entity loader
This commit is contained in:
parent
94cf1aecb6
commit
536a1b89d7
|
|
@ -66,7 +66,7 @@
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"ext-zip": "*",
|
"ext-zip": "*",
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"phpunit/phpunit": "^4.8.36 || ^5.0",
|
"phpunit/phpunit": "^4.8.36 || ^7.0",
|
||||||
"squizlabs/php_codesniffer": "^2.9",
|
"squizlabs/php_codesniffer": "^2.9",
|
||||||
"friendsofphp/php-cs-fixer": "^2.2",
|
"friendsofphp/php-cs-fixer": "^2.2",
|
||||||
"phpmd/phpmd": "2.*",
|
"phpmd/phpmd": "2.*",
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ class Html
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load DOM
|
// Load DOM
|
||||||
|
libxml_disable_entity_loader(true);
|
||||||
$dom = new \DOMDocument();
|
$dom = new \DOMDocument();
|
||||||
$dom->preserveWhiteSpace = $preserveWhiteSpace;
|
$dom->preserveWhiteSpace = $preserveWhiteSpace;
|
||||||
$dom->loadXML($html);
|
$dom->loadXML($html);
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ class TemplateProcessor
|
||||||
*/
|
*/
|
||||||
protected function transformSingleXml($xml, $xsltProcessor)
|
protected function transformSingleXml($xml, $xsltProcessor)
|
||||||
{
|
{
|
||||||
|
libxml_disable_entity_loader(true);
|
||||||
$domDocument = new \DOMDocument();
|
$domDocument = new \DOMDocument();
|
||||||
if (false === $domDocument->loadXML($xml)) {
|
if (false === $domDocument->loadXML($xml)) {
|
||||||
throw new Exception('Could not load the given XML document.');
|
throw new Exception('Could not load the given XML document.');
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,10 @@ class XmlDocument
|
||||||
$this->file = $file;
|
$this->file = $file;
|
||||||
|
|
||||||
$file = $this->path . '/' . $file;
|
$file = $this->path . '/' . $file;
|
||||||
|
libxml_disable_entity_loader(false);
|
||||||
$this->dom = new \DOMDocument();
|
$this->dom = new \DOMDocument();
|
||||||
$this->dom->load($file);
|
$this->dom->load($file);
|
||||||
|
libxml_disable_entity_loader(true);
|
||||||
|
|
||||||
return $this->dom;
|
return $this->dom;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue