diff --git a/h5p.classes.php b/h5p.classes.php index f05382e..83874f8 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1251,7 +1251,9 @@ Class H5PExport { // Build h5p.json $h5pJson = array ( 'title' => $content['title'], - 'language' => $content['language'], + // 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', 'mainLibrary' => $content['library']['name'], 'embedTypes' => $embedTypes, ); @@ -1344,7 +1346,7 @@ class H5PCore { public static $coreApi = array( 'majorVersion' => 1, - 'minorVersion' => 3 + 'minorVersion' => 4 ); public static $styles = array( 'styles/h5p.css', diff --git a/js/h5p.js b/js/h5p.js index 3b5db69..73f833a 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -975,6 +975,13 @@ H5P.setFinished = function (contentId, points, maxPoints) { } }; +/** + * Mimics how php's htmlspecialchars works (the way we use it) + */ +H5P.htmlSpecialChars = function(string) { + return string.toString().replace(//g, '>').replace(/'/g, ''').replace(/"/g, '"'); +}; + // Add indexOf to browsers that lack them. (IEs) if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (needle) {