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] Handle malformed tags in HTML5 parser#62240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:7.4fromlongwave:issue-62236
Oct 31, 2025

Conversation

@longwave
Copy link
Contributor

@longwavelongwave commentedOct 30, 2025
edited
Loading

QA
Branch?7.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#62236
LicenseMIT

Fixes DomCrawler to not crash if it encounters a malformed HTML tag; however the behaviour is still different from the previous version if I naively catch and ignore the exception, as demonstrated by the test case; it should pass on PHP 8.3 and fail on 8.4.

@nicolas-grekas
Copy link
Member

Thanks. The updated behavior makes sense. There's no reason a<script&> should become a<script>. That even looks dangerous.

The test should be added to CrawlerTest.php I think, and have proper skips.

@longwave
Copy link
ContributorAuthor

Ah I didn't see how the tests extended each other before, I understand now. I think this is the right thing to do? The parsers do act differently but I also think it's worth explicitly asserting what each of them do with this edge case, and we might find similar edge cases in the future.

@nicolas-grekas
Copy link
Member

Thank you@longwave.

@nicolas-grekasnicolas-grekas merged commit4e517b7 intosymfony:7.4Oct 31, 2025
12 checks passed
This was referencedNov 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

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

3 participants

@longwave@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp