在Magento中设置libxml_disable_entity_loader(false)-安全问题


Setting libxml_disable_entity_loader(false) in Magento - security concerns

我在服务器上有一个Magento商店,php配置为fcgi。最近,我在libxml_disable_entity_loader中遇到了问题。

显然,根据这个错误报告,将其设置为true将使simplexml_load_file始终返回false。由于我的服务器配置,此设置将持续存在,这使得商店无法进入。

由于此设置是为了安全起见,如果在每次请求之前将其设置为false,情况会有多糟糕?例如,在index.php中。

这个问题在最新版本的Magento中也以同样的方式得到了解决。app中有一个名为bootstrap.php的新文件,包含在index.php中,内容如下:

/**
* Apply workaround for the libxml PHP bugs:
* @link https://bugs.php.net/bug.php?id=62577
* @link https://bugs.php.net/bug.php?id=64938
*/
if (function_exists('libxml_disable_entity_loader')) {
    libxml_disable_entity_loader(false);
}

我没有检查if首先出现的版本,但它在企业版本1.144.2.4