Skip to content

[Issue] fix: remove dead libxml_set_external_entity_loader guard in Config Dom #40950

Description

@m2-assistant

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 (*)

  1. Run lib/internal/Magento/Framework/Config/Test/Unit/DomTest.php — all validation tests pass.
  2. Run the Magento/Framework/Config integration suite — schema validation behaves as before.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: ready for confirmationReported on 2.4.xIndicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Ready for Confirmation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions