Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DomCrawler] Native HTML5 parser throws new DOMException on HTML tag containing ampersand #62236

Closed
@longwave

Description

@longwave

Symfony version(s) affected

7.4.0-BETA1 and 7.4.x-dev

Description

Drupal has various tests to try and prevent cross-site scripting. One of these tests involves HTML tags containing ampersands, which are not expected but should still be parseable by DomCrawler. In Symfony 7.4 on PHP 8.4, this test now fails with an exception.

I have already upgraded to 7.4.x-dev to solve#62233, but that does not handle this particular case.

How to reproduce

I have reduced the test to a minimal test case:

Symfony 7.3:

> new \Symfony\Component\DomCrawler\Crawler('<script&>')->html();= "<head><script></script></head>"

Symfony 7.4:

> new \Symfony\Component\DomCrawler\Crawler('<script&>')->html();   DOMException  Invalid Character Error.

Possible Solution

No response

Additional Context

No response

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp