mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2024-09-19 07:26:33 -04:00
fix 'Array and string offset access using curly braces' deprecated error
This commit is contained in:
parent
b2baa5051b
commit
5374602896
@ -12,7 +12,7 @@ function ordUTF8($c, $index = 0, &$bytes = null)
|
|||||||
$bytes = 0;
|
$bytes = 0;
|
||||||
if ($index >= $len)
|
if ($index >= $len)
|
||||||
return false;
|
return false;
|
||||||
$h = ord($c{$index});
|
$h = ord($c[$index]);
|
||||||
if ($h <= 0x7F) {
|
if ($h <= 0x7F) {
|
||||||
$bytes = 1;
|
$bytes = 1;
|
||||||
return $h;
|
return $h;
|
||||||
@ -21,18 +21,18 @@ function ordUTF8($c, $index = 0, &$bytes = null)
|
|||||||
return false;
|
return false;
|
||||||
else if ($h <= 0xDF && $index < $len - 1) {
|
else if ($h <= 0xDF && $index < $len - 1) {
|
||||||
$bytes = 2;
|
$bytes = 2;
|
||||||
return ($h & 0x1F) << 6 | (ord($c{$index + 1}) & 0x3F);
|
return ($h & 0x1F) << 6 | (ord($c[$index + 1]) & 0x3F);
|
||||||
}
|
}
|
||||||
else if ($h <= 0xEF && $index < $len - 2) {
|
else if ($h <= 0xEF && $index < $len - 2) {
|
||||||
$bytes = 3;
|
$bytes = 3;
|
||||||
return ($h & 0x0F) << 12 | (ord($c{$index + 1}) & 0x3F) << 6
|
return ($h & 0x0F) << 12 | (ord($c[$index + 1]) & 0x3F) << 6
|
||||||
| (ord($c{$index + 2}) & 0x3F);
|
| (ord($c[$index + 2]) & 0x3F);
|
||||||
}
|
}
|
||||||
else if ($h <= 0xF4 && $index < $len - 3) {
|
else if ($h <= 0xF4 && $index < $len - 3) {
|
||||||
$bytes = 4;
|
$bytes = 4;
|
||||||
return ($h & 0x0F) << 18 | (ord($c{$index + 1}) & 0x3F) << 12
|
return ($h & 0x0F) << 18 | (ord($c[$index + 1]) & 0x3F) << 12
|
||||||
| (ord($c{$index + 2}) & 0x3F) << 6
|
| (ord($c[$index + 2]) & 0x3F) << 6
|
||||||
| (ord($c{$index + 3}) & 0x3F);
|
| (ord($c[$index + 3]) & 0x3F);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user