Skip to content

Restore verbatim attribute values from wp_kses_hair#1017

Merged
hi-hai merged 1 commit into
litespeedtech:devfrom
timotei-litespeed:Font_swap-fix_wp7
Jul 17, 2026
Merged

Restore verbatim attribute values from wp_kses_hair#1017
hi-hai merged 1 commit into
litespeedtech:devfrom
timotei-litespeed:Font_swap-fix_wp7

Conversation

@timotei-litespeed

Copy link
Copy Markdown
Contributor

WordPress 7.0+ re-encodes character references in attribute values (e.g., & becomes &), causing parsed values to no longer exist verbatim in the page buffer. This breaks str_replace operations used by Font Display Optm, lazyload placeholder, and other consumers.

Extract and return the raw attribute value from the source string when it only differs from the parsed value by entity encoding, ensuring protocol sanitization still applies while preserving the verbatim representation needed for buffer replacements.

@Tymotey
Tymotey force-pushed the Font_swap-fix_wp7 branch from da2967f to 855d3f3 Compare July 17, 2026 14:32
WordPress 7.0+ re-encodes character references in attribute values (e.g., &litespeedtech#38; becomes &), causing parsed values to no longer exist verbatim in the page buffer. This breaks str_replace operations used by Font Display Optm, lazyload placeholder, and other consumers.
@Tymotey
Tymotey force-pushed the Font_swap-fix_wp7 branch from 855d3f3 to fa9cc73 Compare July 17, 2026 14:42
@hi-hai
hi-hai merged commit 1c3b567 into litespeedtech:dev Jul 17, 2026
1 check passed
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.

2 participants