#61072 closed enhancement (fixed)
HTML API: Add custom text decoder
Reported by: | dmsnell | Owned by: | dmsnell |
---|---|---|---|
Milestone: | 6.6 | Priority: | normal |
Severity: | normal | Version: | 6.6 |
Component: | HTML API | Keywords: | has-patch needs-dev-note |
Focuses: | Cc: |
Description
Provide a custom decoder for strings coming from HTML attributes and
markup. This custom decoder is necessary because of deficiencies in
PHP's html_entity_decode()
function:
- It isn't aware of 720 of the possible named character references in HTML, leaving many out that should be translated.
- It isn't aware of the ambiguous ampersand rule, which allows
conversion of character references in certain contexts when they
are missing their closing
;
.
- It doesn't draw a distinction for the ambiguous ampersand rule when decoding attribute values instead of markup values.
This decoder will also provide some conveniences, such as making a
single-pass and interruptable decode operation possible. This will
provide a number of opportunities to optimize detection and decoding
of things like value prefixes, and whether a value contains a given
substring.
Change History (7)
This ticket was mentioned in Slack in #core-performance by dmsnell. View the logs.
7 months ago
This ticket was mentioned in Slack in #core by dmsnell. View the logs.
6 months ago
This ticket was mentioned in Slack in #core by oglekler. View the logs.
6 months ago
#5
@
6 months ago
- Owner set to dmsnell
- Resolution set to fixed
- Status changed from new to closed
In 58281:
#7
@
5 months ago
Dev note incorporated into Updates to the HTML API
I'm not sure why the PR isn't auto-linking: https://github.com/WordPress/wordpress-develop/pull/6387