Skip to content

testAddHtmlContentWithErrors fails if php is compiled with libxml2 >= 2.14 #61346

@renanrodrigo

Description

@renanrodrigo

Symfony version(s) affected

Seen on 6.4.21 (but potentially latest too)

Description

The new version of libxml2 (2.14) fully implements HTML5. That has effect in the loadHTML method from DOMDocument in php;
The testAddHtmlContentWithErrors test in the Component/DomCrawler/Tests/NativeParserCrawlerTest.php file expects the php snippet there to be invalid, due to the presence of a nav tag. Because of the above change, that snippet is now considered valid HTML and the error does not happen.

How to reproduce

  • Build php using libxml2 >= 2.14
  • run the phpunit test

Possible Solution

As the test is meant to check behavior when the HTML content is invalid, a solution would be changing the HTML snippet in the test to something that is invalid both in HTML4 and HTML5.

Additional Context

This bug was caught while packaging symfony v 6.4.21 in Debian/Ubuntu:

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