From 6282be2fd9b16e05f5b90f98b26d1d9dcee09dec Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Wed, 21 Mar 2007 11:13:48 +0000 Subject: [PATCH] Check for empty text strings. Thanks to Quedoc. --- question/format/xml/format.php | 4 ++++ 1 file changed, 4 insertions(+) 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 )); }