mirror of
https://github.com/pi-hole/web.git
synced 2026-08-23 14:51:12 +01:00
`hexEncode()` padded every code point to four hex digits and `hexDecode()` chopped the string back into four-character groups. That works up to `U+FFFF`, but code points go up to `U+10FFFF`: an emoji such as `U+1F4D2` is encoded as the five-digit group `1f4d2`, after which the decoder is out of step and returns garbage for the remainder of the string. The tables carry the address/domain/client/name of each row in a `data-address` (resp. `data-id`) attribute in this encoding, so a list subscribed with an emoji in its address could neither be deleted nor edited - we asked FTL to remove something that is not in the database and it correctly answered `404`. Widen both functions to six digits, which covers the whole Unicode range. The encoding never leaves the page, so there is nothing to migrate. Signed-off-by: DL6ER <dl6er@dl6er.de>