From f6f6d0fb569ebd8adb75eae4cb5de7d464ba8d12 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 30 Oct 2019 11:28:54 +0100 Subject: [PATCH] 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 --- h5p-development.class.php | 2 +- h5p.classes.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/h5p-development.class.php b/h5p-development.class.php index a60262a..cae5433 100644 --- a/h5p-development.class.php +++ b/h5p-development.class.php @@ -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. } diff --git a/h5p.classes.php b/h5p.classes.php index 7176ad0..6eb3c3e 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -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;