Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Yaml doctrine mapping instead of XML due to issue with XML driver and libxml_disable_entity_loader #2018

Closed
layanto opened this issue Dec 23, 2015 · 1 comment

Comments

@layanto
Copy link

layanto commented Dec 23, 2015

There is a bug with PHP/libxml where simplexml_load_file (used by doctrine mapping XML driver) will fail even when loading xml with no external entities if libxml_disable_entity_loader is set to true. This bug still exists with latest PHP5.6 and latestt PHP7 (didn't check PHP5.5 but expect to be affected too). See https://bugs.php.net/bug.php?id=62577&edit=1 and http://www.serverphorums.com/read.php?7,1262794 (discussion on making libxml_disable_entity_loader setting default to true for PHP7 or 7.1).

This bug causes error in reading FosUser's orm mapping in XML. See #1062

I have raised this with doctrine project too. See doctrine/orm#3788 and https://groups.google.com/forum/m/#!topic/doctrine-user/vAb_3zcz6vU

The PHP bug was reported back in 2012 and is still not fixed. My suggestions (in order of preference):

  1. PHP/libxml fixing this bug but as bug unresolved for many years probably won't happen
  2. Change XML driver of doctrine to be able to load XML mapping when libxml_disable_entity_loader is set to true (similar to what OwnCloud did, see https://github.com/owncloud/core/pull/7498/files)
  3. Change FosUser doctrine mapping to use YML instead of XML hence avoiding this bug
@layanto layanto changed the title Use Yaml doctrine mapping instead of XML due to issue with XML driver and libxml_disable_enttitty_loader Use Yaml doctrine mapping instead of XML due to issue with XML driver and libxml_disable_entity_loader Dec 23, 2015
@stof
Copy link
Member

stof commented Dec 24, 2016

Given that the Doctrine team wants to remove the YAML driver in Doctrine 3, this won't happen

@stof stof closed this as completed Dec 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants