Merge pull request #69 from stronk7/php74_curly_array_string_offset

Fix PHP 7.4 don't use curly braces for array/string offset
revert-68-libraryPathSubclass wp-1.15.0
Frode Petterson 2019-10-30 12:48:13 +01:00 committed by GitHub
commit 541f6d8415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;