From 171022696687537d4e3b66d4208c095a7b65556e Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Wed, 21 Mar 2007 11:18:28 +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 6c657d63a0..2b0b662802 100755 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -74,6 +74,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 )); } -- 2.39.5