Make sure that texts are texts

namespaces
Svein-Tore Griff With 2013-07-24 18:01:07 +02:00
parent bd1f25448b
commit 9a4f57fa7d
1 changed files with 3 additions and 0 deletions

View File

@ -1195,6 +1195,9 @@ class H5PContentValidator {
* Validate given text value against text semantics. * Validate given text value against text semantics.
*/ */
public function validateText(&$text, $semantics) { public function validateText(&$text, $semantics) {
if (!is_string($text)) {
$text = '';
}
if (isset($semantics->tags)) { if (isset($semantics->tags)) {
// Not testing for empty array allows us to use the 4 defaults without // Not testing for empty array allows us to use the 4 defaults without
// specifying them in semantics. // specifying them in semantics.