Skip to content

Commit

Permalink
Merge pull request #69 from stronk7/php74_curly_array_string_offset
Browse files Browse the repository at this point in the history
Fix PHP 7.4 don't use curly braces for array/string offset
  • Loading branch information
icc authored Oct 30, 2019
2 parents 143a44c + f6f6d0f commit 541f6d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion h5p-development.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private function findLibraries($path) {
$contents = scandir($path);

for ($i = 0, $s = count($contents); $i < $s; $i++) {
if ($contents[$i]{0} === '.') {
if ($contents[$i][0] === '.') {
continue; // Skip hidden stuff.
}

Expand Down
2 changes: 1 addition & 1 deletion h5p.classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2744,7 +2744,7 @@ public static function snakeToCamel($arr, $obj = false) {
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;
Expand Down

0 comments on commit 541f6d8

Please sign in to comment.