Skip to content

[config] load fails if libxml_disable_entity_loader is globally set to true  #18876

Closed
@krichprollsch

Description

@krichprollsch

If a libxml_disable_entity_loader is set to true somewhere, the xml parsing fails after a cache directory deletion with the error:

[WARNING 1549] failed to load external entity "file:////home/pierre/project/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd" (in n/a - line 0, column 0)
[WARNING 3084] Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'file:////home/pierre/project/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd'. Skipping the import. (in in_memory_buffer - line 8, column 0)
[ERROR 1845] Element '{http://symfony.com/schema/dic/services}container': No matching global declaration available for the validation root. (in /home/pierre/project/web/ - line 5, column 0)

You can reproduce with a fresh install of symfony and a bundle using xml config.
Add a libxml_disable_entity_loader(true); before the kernel boot and remove the cache directory.

The issue exists only via a web request, the console cli is not impacted.

Im not sure how to fix the problem. We could force libxml_disable_entity_loader(false) before the xml validation test [1] as it appears to be required, and reset the value after.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions