From 2d7824aa932a6b217bc16a4f7b53c6ab654a1790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20J=C3=B8rgensen?= Date: Thu, 6 Nov 2014 11:13:24 +0100 Subject: [PATCH] Fix for language containing empty string in H5P export (h5p.json) --- h5p.classes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index 827903a..905b72c 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1433,7 +1433,7 @@ Class H5PExport { 'title' => $content['title'], // TODO - stop using 'und', this is not the preferred way. // Either remove language from the json if not existing, or use "language": null - 'language' => isset($content['language']) ? $content['language'] : 'und', + 'language' => (isset($content['language']) && strlen(trim($content['language'])) !== 0) ? $content['language'] : 'und', 'mainLibrary' => $content['library']['name'], 'embedTypes' => $embedTypes, );