Code development platform for open source projects from the European Union institutions 🔵 EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content

Disabling the libxml entity loader will globally break file loading

Created by: samsonradu

Disabling the entity loader in the Introspector will globally break the load() function:

libxml_disable_entity_loader(true);      
...
$xsl = new \DOMDocument();
$xsl->load(__DIR__ . '/transform.xsl');

The above will throw an error:

failed to load external entity "/path/to/transform.xsl"

https://github.com/ecphp/cas-lib/blob/6faa3012f64ac5d646fd08a2b775b84c2e1e97d8/src/Introspection/Introspector.php#L90

Perhaps it would be good to reset the entity loader to its initial value after loading the XML string.