diff --git a/question/format/xml/format.php b/question/format/xml/format.php index 848084d9140..d7a42e92370 100755 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -71,6 +71,10 @@ class qformat_xml extends qformat_default { * @return string processed text */ function import_text( $text ) { + // quick sanity check + if (empty($text)) { + return ''; + } $data = $text[0]['#']; return addslashes(trim( $data )); }