Make sure that texts are texts
parent
bd1f25448b
commit
9a4f57fa7d
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue