Skip to content

HTML API: Preserve decoder match length on named-reference miss#66

Closed
sirreal wants to merge 6 commits into
trunkfrom
fix/html-decoder-token-map-null
Closed

HTML API: Preserve decoder match length on named-reference miss#66
sirreal wants to merge 6 commits into
trunkfrom
fix/html-decoder-token-map-null

Conversation

@sirreal

@sirreal sirreal commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Preserve the by-reference match length when WP_HTML_Decoder::read_character_reference() misses a named reference.
  • Check for null from WP_Token_Map::read_token() to match the token-map API contract.
  • Add coverage ensuring unmatched named references do not mutate the caller's match length.

Testing

  • Focused decoder PHPUnit coverage for unmatched named references passes.
  • PHPCS alignment fixes are committed.
  • codex review --base trunk.

Trac ticket: https://core.trac.wordpress.org/ticket/65372

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Splitting the fuzzer-discovered fix, PR description cleanup, and code review.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@sirreal sirreal marked this pull request as ready for review June 12, 2026 22:11
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jonsurrell, dmsnell.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


/**
* Ensures unmatched named character references leave the by-ref match length unchanged.
*

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ticket 65372

@dmsnell dmsnell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what’s the state of this @sirreal? looks like it’s probably good to go

@sirreal

sirreal commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Yes this is mostly ready, I just need to clean it up and move it over to the main repo.

@sirreal sirreal force-pushed the fix/html-decoder-token-map-null branch from 5a54c8a to 674d0dc Compare July 1, 2026 12:03
@sirreal

sirreal commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

WordPress#12379

@sirreal sirreal closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants