summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2013-02-25 00:49:17 +0100
committerChristian Heimes <christian@python.org>2013-02-25 00:49:17 +0100
commitf0e0a6fec15339cff113497fe65fe7ec11691c76 (patch)
tree4f8ad7a878647171e36cf57ff8ec0fbc260ec4cc
parent2d313278fbf41bc8758611efe0a4ef047e87c3be (diff)
downloaddefusedxml-git-f0e0a6fec15339cff113497fe65fe7ec11691c76.tar.gz
PHP's libxml_disable_entity_loader() prevents entity expansion
-rwxr-xr-xother/php.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/other/php.php b/other/php.php
index e35665b..f1f3a2a 100755
--- a/other/php.php
+++ b/other/php.php
@@ -5,6 +5,9 @@
// $options = LIBXML_NONET;
$options = LIBXML_NOENT;
+/* LIBXML_NOENT doesn't have any effect but
+ libxml_disable_entity_loader(true) works */
+
$xml = simplexml_load_file($argv[1], "SimpleXMLElement", $options);
$data = (string)$xml;
echo strlen($data);