有两个文件xml.php: <?php
var_dump(simplexml_load_file('test.xml'));
?>
test.xml:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE a[
<!ENTITY b SYSTEM "http://127.0.0.1/index.html">
]>
<a>&b;</a>
访问xml.php后,结果如下:
object(SimpleXMLElement)#1 (1) { ["b"]=> object(SimpleXMLElement)#2 (1) { ["b"]=> object(SimpleXMLElement)#3 (0) { } } }
且服务器并没有收到get index的请求
为什么外部实体没有解析呢?
var_dump(simplexml_load_file('test.xml'));
?>
test.xml:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE a[
<!ENTITY b SYSTEM "http://127.0.0.1/index.html">
]>
<a>&b;</a>
访问xml.php后,结果如下:
object(SimpleXMLElement)#1 (1) { ["b"]=> object(SimpleXMLElement)#2 (1) { ["b"]=> object(SimpleXMLElement)#3 (0) { } } }
且服务器并没有收到get index的请求
为什么外部实体没有解析呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货