Skip to content

Conversation

@peterwilsoncc
Copy link
Contributor

No description provided.

dmsnell added a commit to dmsnell/wordpress-develop that referenced this pull request Oct 3, 2023
In order to clarify the main loop of `_esc_attr_single_pass_utf8` I've moved the
named character reference lookup outside of the function and into a new high-performance
token set class dubbed `WP_Token_Set`. I created this class to retain the performance
perks brought by the optimized data format.

There are two lookup sets though because WordPress traditionally has its own custom
set based on HTML4, but I would like to see us allow everything that HTML5 allows,
including the common `'` so we don't have to keep writing `&WordPress#39;` (because
that doesn't stand out as clearly as the name does).

Performance in this change is even better than it was previously because I've removed
the substitutions from the lookup table and that removes both iteration and working
memory. In order to provide the reverse function, decoding these entities, it would
probably be best to create two separate tables, or add a fixed byte length and offset
value as a lookup into another table so that we can avoid reintroducing the double
crawling scan that we had before.
@peterwilsoncc peterwilsoncc deleted the 46029-remove-was-gute-active branch June 17, 2025 00:29
pento pushed a commit that referenced this pull request Aug 7, 2025
… references.

Fixes an issue where `wp_kses_normalize_entities` would transform inputs like "'" into "'", changing the intended HTML text.

This behavior has present since the initial version of KSES was introduced in [649].

[2896] applied the normalization to post content for users without the "unfiltered_html" capability.

Developed in #9099.

Props jonsurrell, dmsnell, sirlouen.
Fixes #63630.


git-svn-id: https://develop.svn.wordpress.org/trunk@60616 602fd350-edb4-49c9-b593-d223f7449a82
jonnynews pushed a commit to spacedmonkey/wordpress-develop that referenced this pull request Sep 24, 2025
… references.

Fixes an issue where `wp_kses_normalize_entities` would transform inputs like "&WordPress#39;" into "&WordPress#39;", changing the intended HTML text.

This behavior has present since the initial version of KSES was introduced in [649].

[2896] applied the normalization to post content for users without the "unfiltered_html" capability.

Developed in WordPress#9099.

Props jonsurrell, dmsnell, sirlouen.
Fixes #63630.


git-svn-id: https://develop.svn.wordpress.org/trunk@60616 602fd350-edb4-49c9-b593-d223f7449a82
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.

1 participant