1
0
mirror of synced 2025-03-12 23:59:05 +03:00

Merge branch 'fix/#6633-#3788-avoid-xml-external-entity-loading-errors-in-xml-mapping-driver'

Close #6633
Close #3788
This commit is contained in:
Marco Pivetta 2017-08-18 21:12:37 +02:00
commit a426808a16
No known key found for this signature in database
GPG Key ID: 4167D3337FD9D629

View File

@ -838,7 +838,8 @@ class XmlDriver extends FileDriver
protected function loadMappingFile($file) protected function loadMappingFile($file)
{ {
$result = []; $result = [];
$xmlElement = simplexml_load_file($file); // Note: we do not use `simplexml_load_file()` because of https://bugs.php.net/bug.php?id=62577
$xmlElement = simplexml_load_string(file_get_contents($file));
if (isset($xmlElement->entity)) { if (isset($xmlElement->entity)) {
foreach ($xmlElement->entity as $entityElement) { foreach ($xmlElement->entity as $entityElement) {