From db3f7a489c4f5e0f33175a6ed86b45c7e58580dc Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Wed, 21 Mar 2007 11:17:38 +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 23fae5e16e0..87fbd6972d6 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 )); }