Skip to content

Commit 5374602

Browse files
committed
fix 'Array and string offset access using curly braces' deprecated error
1 parent b2baa50 commit 5374602

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

libs/php_idn/idna.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function ordUTF8($c, $index = 0, &$bytes = null)
1212
$bytes = 0;
1313
if ($index >= $len)
1414
return false;
15-
$h = ord($c{$index});
15+
$h = ord($c[$index]);
1616
if ($h <= 0x7F) {
1717
$bytes = 1;
1818
return $h;
@@ -21,18 +21,18 @@ function ordUTF8($c, $index = 0, &$bytes = null)
2121
return false;
2222
else if ($h <= 0xDF && $index < $len - 1) {
2323
$bytes = 2;
24-
return ($h & 0x1F) << 6 | (ord($c{$index + 1}) & 0x3F);
24+
return ($h & 0x1F) << 6 | (ord($c[$index + 1]) & 0x3F);
2525
}
2626
else if ($h <= 0xEF && $index < $len - 2) {
2727
$bytes = 3;
28-
return ($h & 0x0F) << 12 | (ord($c{$index + 1}) & 0x3F) << 6
29-
| (ord($c{$index + 2}) & 0x3F);
28+
return ($h & 0x0F) << 12 | (ord($c[$index + 1]) & 0x3F) << 6
29+
| (ord($c[$index + 2]) & 0x3F);
3030
}
3131
else if ($h <= 0xF4 && $index < $len - 3) {
3232
$bytes = 4;
33-
return ($h & 0x0F) << 18 | (ord($c{$index + 1}) & 0x3F) << 12
34-
| (ord($c{$index + 2}) & 0x3F) << 6
35-
| (ord($c{$index + 3}) & 0x3F);
33+
return ($h & 0x0F) << 18 | (ord($c[$index + 1]) & 0x3F) << 12
34+
| (ord($c[$index + 2]) & 0x3F) << 6
35+
| (ord($c[$index + 3]) & 0x3F);
3636
}
3737
else
3838
return false;

0 commit comments

Comments
 (0)