PHP 7.4 fix, don't use curly braces for array/string offset

The array and string offset access syntax using curly braces is deprecated.
Use $str[$idx] instead of $str{$idx}.
RFC: https://wiki.php.net/rfc/deprecate_curly_braces_array_access
pull/69/head
Eloy Lafuente (stronk7) 2019-10-30 11:28:54 +01:00
parent f37231eb3a
commit f6f6d0fb56
2 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ class H5PDevelopment {
$contents = scandir($path);
for ($i = 0, $s = count($contents); $i < $s; $i++) {
if ($contents[$i]{0} === '.') {
if ($contents[$i][0] === '.') {
continue; // Skip hidden stuff.
}

View File

@ -2744,7 +2744,7 @@ class H5PCore {
foreach ($arr as $key => $val) {
$next = -1;
while (($next = strpos($key, '_', $next + 1)) !== FALSE) {
$key = substr_replace($key, strtoupper($key{$next + 1}), $next, 2);
$key = substr_replace($key, strtoupper($key[$next + 1]), $next, 2);
}
$newArr[$key] = $val;