Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML API: avoid processing incomplete tokens #5725

Commits on Dec 16, 2023

  1. HTML API: Avoid processing incomplete syntax elements.

    The HTML Tag Processor is able to know if it starts parsing a syntax element
    and reaches the end of the document before it reaches the end of the element.
    In these cases, after this patch, the processor will indicate this condition.
    
    For example, when processing `<div><input type="te` there is an incomplete INPUT
    element. The processor will fail to find the INPUT, it will pause right after
    the DIV, and `paused_at_incomplete_token()` will return `true`.
    
    This patch doesn't change any existing behaviors, but it adds the new method
    to report on the final failure condition. It provides a mechanism for later
    use to add chunked parsing to the class, wherein it will be possible to process
    a document without having the entire document loaded in memory, for example
    when processing unbuffered output.
    
    This is also a necessary change for adding the ability to scan every token in
    the document. Currently the Tag Processor only exposes tags as tokens, but it
    will need to process `#text` nodes, HTML comments, and other markup in order
    to enable behaviors in the HTML Processor and in refactors of existing HTML
    processing in Core.
    dmsnell committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    35502ad View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2023

  1. Add ticket number

    dmsnell committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    c3166be View commit details
    Browse the repository at this point in the history
  2. HTML API: Prevent out-of-bounds string access.

    Rebuild of 8905faf after WordPress#5725.
    
    Co-authored-by: Jon Surrell <sirreal@users.noreply.github.com>
    Co-authored-by: Bernie Reiter <bernhard-reiter@git.wordpress.org>
    3 people committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    9e7167a View commit details
    Browse the repository at this point in the history
  3. Fix bug found from HTML5Tests for incomplete SCRIPT tag closer

    Co-authored-by: Jon Surrell <sirreal@users.noreply.github.com>
    dmsnell and sirreal committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    8488317 View commit details
    Browse the repository at this point in the history