Skip to content
Snippets Groups Projects
Commit eb437c64 authored by Andreas Hennings's avatar Andreas Hennings
Browse files

Issue #3270010 by donquixote: PHP 7.4+: Avoid array offset on integer when checking array keys.

parent d88c9880
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ abstract class Configurator_GroupBase extends Configurator_GroupGrandBase {
* @return $this
*/
public function keySetConfigurator($key, ConfiguratorInterface $configurator, $label) {
if ('#' === $key[0]) {
if ($key !== '' && is_string($key) && $key[0] === '#') {
throw new \InvalidArgumentException("Key '$key' must not begin with '#'.");
}
$this->configurators[$key] = $configurator;
......
......@@ -72,7 +72,7 @@ class DataUtil {
*/
private static function arrayStripDangerousKeysRecursive(array &$data) {
foreach ($data as $key => $value) {
if ($key !== '' && $key[0] === '#') {
if ($key !== '' && is_string($key) && $key[0] === '#') {
unset($data[$key]);
}
elseif (is_array($value)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment