From: thepurpleblob Date: Wed, 21 Mar 2007 11:18:28 +0000 (+0000) Subject: Check for empty text strings. Thanks to Quedoc. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=171022696687537d4e3b66d4208c095a7b65556e;p=moodle.git Check for empty text strings. Thanks to Quedoc. --- 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 )); }