From: thepurpleblob Date: Fri, 19 Sep 2008 10:01:47 +0000 (+0000) Subject: MDL-16570 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3695cfa93f351dc3b9e2f0d8c7ade222bd952596;p=moodle.git MDL-16570 Use CDATA sections for text where required. More readable and less error prone. Merged from MOODLE_19_STABLE --- diff --git a/question/format/xml/format.php b/question/format/xml/format.php index df5a6aaf6a..8f8edad9cf 100755 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -692,8 +692,10 @@ class qformat_xml extends qformat_default { function writetext( $raw, $ilev=0, $short=true) { $indent = str_repeat( " ",$ilev ); - // encode the text to 'disguise' HTML content - $raw = htmlspecialchars( $raw ); + // if required add CDATA tags + if (!empty($raw) and (htmlspecialchars($raw)!=$raw)) { + $raw = ""; + } if ($short) { $xml = "$indent$raw\n";