diff --git a/js/h5p.js b/js/h5p.js index 3b5db69..0500cc9 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) {