From 9a4f57fa7dea12ddc7b52089ac82091f98760dc5 Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Wed, 24 Jul 2013 18:01:07 +0200 Subject: [PATCH] Make sure that texts are texts --- h5p.classes.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/h5p.classes.php b/h5p.classes.php index 9afe9ec..97c7064 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -1195,6 +1195,9 @@ class H5PContentValidator { * Validate given text value against text semantics. */ public function validateText(&$text, $semantics) { + if (!is_string($text)) { + $text = ''; + } if (isset($semantics->tags)) { // Not testing for empty array allows us to use the 4 defaults without // specifying them in semantics.