1
0
Fork 0

Merge pull request #10597 from annando/warning

Fixes "PHP Warning:  key() expects parameter 1 to be array, string given"
This commit is contained in:
Hypolite Petovan 2021-08-12 11:48:35 -04:00 committed by GitHub
commit a364436623
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -193,7 +193,7 @@ class JsonLD
} }
// If it isn't an array yet, make it to one // If it isn't an array yet, make it to one
if (!is_int(key($array[$element]))) { if (!is_array($array[$element]) || !is_int(key($array[$element]))) {
$array[$element] = [$array[$element]]; $array[$element] = [$array[$element]];
} }