com php-src: Fixed DOM tests when using libxml2 versions patched against CVE-2014-0191: ext/dom/tests/DOMDocument_validate_external _dtd.phpt
ext/dom/tests/bug67081.phpt ext/l ibxml/tests/libxml_set_external_entity_loader_variati on1.phpt
| From: | Matteo Beccati | Date: | Mon, 09 Jun 2014 05:08:04 +0000 |
| Subject: | com php-src: Fixed DOM tests when using libxml2 versions patched against CVE-2014-0191: ext/dom/tests/DOMDocument_validate_external _dtd.phpt ext/dom/tests/bug67081.phpt ext/l ibxml/tests/libxml_set_external_entity_loader_variati on1.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78766@lists.php.net to get a copy of this message | ||
Commit: 8cfdf20ccf1a555264b67636826a2d9e9d35d8d0
Author: Matteo Beccati <mbeccati@php.net> Wed, 4 Jun 2014 13:26:24 +0200
Parents: dd0e96cca360c5584ec80319ae99fc07c0f2c5f3
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8cfdf20ccf1a555264b67636826a2d9e9d35d8d0
Log:
Fixed DOM tests when using libxml2 versions patched against CVE-2014-0191
DOMDocument::substituteEntities needs to be set to true in order for
external entities to be parsed.
Changed paths:
M ext/dom/tests/DOMDocument_validate_external_dtd.phpt
M ext/dom/tests/bug67081.phpt
M ext/libxml/tests/libxml_set_external_entity_loader_variation1.phpt
Diff:
diff --git a/ext/dom/tests/DOMDocument_validate_external_dtd.phpt
b/ext/dom/tests/DOMDocument_validate_external_dtd.phpt
index 51a044c..dd4ec96 100644
--- a/ext/dom/tests/DOMDocument_validate_external_dtd.phpt
+++ b/ext/dom/tests/DOMDocument_validate_external_dtd.phpt
@@ -12,6 +12,7 @@ require_once dirname(__FILE__) .'/skipif.inc';
// reusing existing xml: http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/dom.xml?view=co&content-type=text%2Fplain
// reusing existing dtd: http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/dom.ent?view=co&content-type=text%2Fplain
$dom = new DOMDocument('1.0');
+$dom->substituteEntities = true;
$dom->load(dirname(__FILE__).'/dom.xml');
var_dump($dom->validate());
?>
diff --git a/ext/dom/tests/bug67081.phpt b/ext/dom/tests/bug67081.phpt
index 56c2c8e..c6dc007 100644
--- a/ext/dom/tests/bug67081.phpt
+++ b/ext/dom/tests/bug67081.phpt
@@ -7,18 +7,22 @@ require_once('skipif.inc');
--FILE--
<?php
$domDocument = new DOMDocument();
+ $domDocument->substituteEntities = true;
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_0.xml");
var_dump($domDocument->doctype->internalSubset);
$domDocument = new DOMDocument();
+ $domDocument->substituteEntities = true;
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_1.xml");
var_dump($domDocument->doctype->internalSubset);
$domDocument = new DOMDocument();
+ $domDocument->substituteEntities = true;
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_2.xml");
var_dump($domDocument->doctype->internalSubset);
$domDocument = new DOMDocument();
+ $domDocument->substituteEntities = true;
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "dom.xml");
var_dump($domDocument->doctype->internalSubset);
?>
diff --git a/ext/libxml/tests/libxml_set_external_entity_loader_variation1.phpt
b/ext/libxml/tests/libxml_set_external_entity_loader_variation1.phpt
index c9c4594..9581927 100644
--- a/ext/libxml/tests/libxml_set_external_entity_loader_variation1.phpt
+++ b/ext/libxml/tests/libxml_set_external_entity_loader_variation1.phpt
@@ -37,6 +37,7 @@ libxml_set_external_entity_loader(
);
$dd = new DOMDocument;
+$dd->substituteEntities = true;
$dd->resolveExternals = true;
$r = $dd->loadXML($xml);
var_dump($dd->validate());