Replace chr() by mb_chr() and remove the workaround
Some checks failed
E2E / Linux / PHP ${{ matrix.php }} (8.1) (push) Has been cancelled
E2E / Linux / PHP ${{ matrix.php }} (8.3) (push) Has been cancelled
E2E / Linux / PHP ${{ matrix.php }} (8.5) (push) Has been cancelled
CI / Coding Style (push) Has been cancelled
CI / Static Analysis (push) Has been cancelled
Message Rendering / Linux / PHP ${{ matrix.php }} (8.3) (push) Has been cancelled
Message Rendering / Linux / PHP ${{ matrix.php }} (8.4) (push) Has been cancelled
Message Rendering / Linux / PHP ${{ matrix.php }} (8.5) (push) Has been cancelled
Unit / Linux / PHP ${{ matrix.php }} (8.1) (push) Has been cancelled
Unit / Linux / PHP ${{ matrix.php }} (8.2) (push) Has been cancelled
Unit / Linux / PHP ${{ matrix.php }} (8.3) (push) Has been cancelled
Unit / Linux / PHP ${{ matrix.php }} (8.4) (push) Has been cancelled
Unit / Linux / PHP ${{ matrix.php }} (8.5) (push) Has been cancelled
Unit / Windows / PHP ${{ matrix.php }} (8.1) (push) Has been cancelled
Unit / Windows / PHP ${{ matrix.php }} (8.2) (push) Has been cancelled
Unit / Windows / PHP ${{ matrix.php }} (8.3) (push) Has been cancelled
Unit / Windows / PHP ${{ matrix.php }} (8.4) (push) Has been cancelled
Unit / Windows / PHP ${{ matrix.php }} (8.5) (push) Has been cancelled

This commit is contained in:
Pablo Zmdl 2025-09-09 15:28:52 +02:00
parent 9f495225da
commit 3e15b10425

View File

@ -724,14 +724,7 @@ class rcube_utils
public static function xss_entity_decode(string $content): string
{
$callback = static function ($matches) {
$bytevalue = hexdec((string) $matches[1]);
// chr() only covers values between 0 and 255. The following 4 lines are from the former default behaviour
// to ensure that, which is now deprecated, so we now explicitly do the shifting here.
while ($bytevalue < 0) {
$bytevalue += 256;
}
$bytevalue %= 256;
return chr($bytevalue);
return strval(mb_chr(hexdec((string) $matches[1])));
};
$out = html_entity_decode(html_entity_decode($content));