From 4525d6383f8c3f715df2506c20e7b43194a6a268 Mon Sep 17 00:00:00 2001 From: Thomas Horn Sivertsen <4159138+tsivert@users.noreply.github.com> Date: Thu, 21 Mar 2019 10:30:09 +0100 Subject: [PATCH] Incorrect json (#58) Default language is of type text and should therefore add quotes around the value like source, license and license_version do. --- 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 830e9dc..572cfd0 100644 --- a/h5p-metadata.class.php +++ b/h5p-metadata.class.php @@ -65,7 +65,7 @@ abstract class H5PMetadata { ',"yearFrom":' . (isset($content->year_from) ? $content->year_from : 'null') . ',"yearTo":' . (isset($content->year_to) ? $content->year_to : 'null') . ',"changes":' . (isset($content->changes) ? $content->changes : 'null') . - ',"defaultLanguage":' . (isset($content->default_language) ? $content->default_language : 'null') . + ',"defaultLanguage":' . (isset($content->default_language) ? '"' . $content->default_language . '"' : 'null') . ',"authorComments":' . (isset($content->author_comments) ? json_encode($content->author_comments) : 'null') . '}'; }