You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resulting string contains random invalid UTF-8 sequences like with the οΏ½ character. With the repeated emoji, emojis become corrupted. If you repeat the string for longer, there are more corrupted bytes in random places.
I initially spotted this bug when parsing a real HTML document and used textContent (innerHTML produces the same issue) on an element I found with xpath.
Activity
xPaw commentedon Jan 15, 2025
FYI this is reproducible with 2-byte utf-8 sequences too, but not ascii.
ndossche commentedon Jan 15, 2025
I'll try to have a look at the encoding code tomorrow.
Fix phpGH-17481: UTF-8 corruption in \Dom\HTMLDocument
Merge branch 'PHP-8.4'
Fix GH-17481: UTF-8 corruption in \Dom\HTMLDocument
Fix potential read of uninitialized padding data in DOM
Fix potential read of uninitialized padding data in DOM (#17628)
Fix potential read of uninitialized padding data in DOM (#17628)
Fix potential read of uninitialized padding data in DOM (#17628)