#61072 closed enhancement (fixed)
HTML API: Add custom text decoder
| Reported by: | dmsnell | Owned by: | dmsnell |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.6 |
| Component: | HTML API | Version: | 6.6 |
| Severity: | normal | Keywords: | has-patch needs-dev-note |
| Cc: | Focuses: |
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 (8)
This ticket was mentioned in Slack in #core-performance by dmsnell. View the logs.
2 years ago
This ticket was mentioned in Slack in #core by dmsnell. View the logs.
2 years ago
This ticket was mentioned in Slack in #core by oglekler. View the logs.
2 years ago
#7
@
2 years ago
Dev note incorporated into Updates to the HTML API
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I'm not sure why the PR isn't auto-linking: https://github.com/WordPress/wordpress-develop/pull/6387