Skip to content

Commit e8c7800

Browse files
committed
PHP 8.1 doesn't like implicit float to int conversions
Signed by Shawn Bulen, bulens@pacbell.net
1 parent 4c51667 commit e8c7800

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/Subs-Charset.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,16 @@ function utf8_decompose($chars, $compatibility = false)
440440
for ($i=0; $i < count($chars); $i++)
441441
{
442442
// Hangul characters.
443+
// http://unicode.org/L2/L2006/06310-hangul-decompose9.pdf
443444
if ($chars[$i] >= "\xEA\xB0\x80" && $chars[$i] <= "\xED\x9E\xA3")
444445
{
445446
if (!function_exists('mb_ord'))
446447
require_once($sourcedir . '/Subs-Compat.php');
447448

448449
$s = mb_ord($chars[$i]);
449450
$sindex = $s - 0xAC00;
450-
$l = 0x1100 + $sindex / (21 * 28);
451-
$v = 0x1161 + ($sindex % (21 * 28)) / 28;
451+
$l = (int) (0x1100 + $sindex / (21 * 28));
452+
$v = (int) (0x1161 + ($sindex % (21 * 28)) / 28);
452453
$t = $sindex % 28;
453454

454455
$chars[$i] = implode('', array(mb_chr($l), mb_chr($v), $t ? mb_chr(0x11A7 + $t) : ''));

0 commit comments

Comments
 (0)