This issue is automatically created based on existing pull request: #40944: fix: remove dead libxml_set_external_entity_loader guard in Config Dom
Description
Remove the dead libxml_set_external_entity_loader() availability guard from Magento\Framework\Config\Dom::validateDomDocument().
Problem
The method starts with a guard that is always false:
if (!function_exists('libxml_set_external_entity_loader')) {
return [];
}
libxml_set_external_entity_loader() is provided by ext-libxml, which is bundled with PHP and cannot be disabled; the function has existed since PHP 5.4. Since Magento requires PHP 8.3+, this branch is unreachable.
Worse, if the branch were ever taken it would return an empty error list — silently skipping XSD schema validation entirely and reporting the document as valid.
Solution
Remove the dead guard. Behavior on every supported PHP version is unchanged.
Files Changed
lib/internal/Magento/Framework/Config/Dom.php
Related Pull Requests
Same cleanup pattern as #40686, #40687, #40688.
Manual testing scenarios (*)
- Run
lib/internal/Magento/Framework/Config/Test/Unit/DomTest.php — all validation tests pass.
- Run the
Magento/Framework/Config integration suite — schema validation behaves as before.
Contribution checklist (*)
This issue is automatically created based on existing pull request: #40944: fix: remove dead libxml_set_external_entity_loader guard in Config Dom
Description
Remove the dead
libxml_set_external_entity_loader()availability guard fromMagento\Framework\Config\Dom::validateDomDocument().Problem
The method starts with a guard that is always false:
libxml_set_external_entity_loader()is provided by ext-libxml, which is bundled with PHP and cannot be disabled; the function has existed since PHP 5.4. Since Magento requires PHP 8.3+, this branch is unreachable.Worse, if the branch were ever taken it would return an empty error list — silently skipping XSD schema validation entirely and reporting the document as valid.
Solution
Remove the dead guard. Behavior on every supported PHP version is unchanged.
Files Changed
lib/internal/Magento/Framework/Config/Dom.phpRelated Pull Requests
Same cleanup pattern as #40686, #40687, #40688.
Manual testing scenarios (*)
lib/internal/Magento/Framework/Config/Test/Unit/DomTest.php— all validation tests pass.Magento/Framework/Configintegration suite — schema validation behaves as before.Contribution checklist (*)