HTML Api: Fix out of bounds string access#5793
HTML Api: Fix out of bounds string access#5793sirreal wants to merge 7 commits intoWordPress:trunkfrom
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
6145140 to
69a7965
Compare
|
@sirreal I've cherry-picked my rebuilt change in 9e7167a onto #5725. If you want we can re-target this PR against that branch or close it out. I'm worried about losing the change in the stacked PRs if we merge it first, but if you prefer that we can do that and I'll rebuild avoid-parsing-incomplete-tokens on top of it. |
|
Committed to Core as part of https://core.trac.wordpress.org/changeset/57211 (see #5793 (comment)). |
Trac ticket: https://core.trac.wordpress.org/ticket/60108
The HTML API Tag Processor may attempt to perform out of range string index access, which may manifest as:
This PR also reuses a
$doc_lengthvariable. There's astrlen( $html )performed at the top of the function and the result can be reused instead of callingstrlenrepeatedly.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.