From 066ea94b1169b529f8309de14f696444206e67dd Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Fri, 26 Oct 2018 09:35:24 +0200 Subject: [PATCH] Fix warning in toDBArray() Prevent accessing keys of metadata that don't exist --- h5p-metadata.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h5p-metadata.class.php b/h5p-metadata.class.php index 6884e0e..80d8eff 100644 --- a/h5p-metadata.class.php +++ b/h5p-metadata.class.php @@ -85,7 +85,7 @@ abstract class H5PMetadata { continue; } - if ($metadata[$key] === null || isset($metadata[$key])) { + if (array_key_exists($key, $metadata) && ($metadata[$key] === null || isset($metadata[$key]))) { $value = $metadata[$key]; $db_field_name = strtolower(preg_replace('/(?