From 37b1718f09fbcc8412ed5dd8e9bbdc399818ea3a Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Fri, 26 Apr 2013 12:16:36 +1000 Subject: [PATCH] Fixed issue #7800: HTML-tags visible in queXML (PDF) --- application/helpers/export_helper.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/application/helpers/export_helper.php b/application/helpers/export_helper.php index b74cdce0abf..3b8eea48908 100644 --- a/application/helpers/export_helper.php +++ b/application/helpers/export_helper.php @@ -818,9 +818,9 @@ function getXMLDataSingleTable($iSurveyID, $sTableName, $sDocType, $sXMLTableTag /** * from export_structure_quexml.php */ -function QueXMLCleanup($string) +function QueXMLCleanup($string,$allow = '

') { - return html_entity_decode(trim(strip_tags(str_ireplace("
","\n",$string),'

')),ENT_QUOTES,'UTF-8'); + return html_entity_decode(trim(strip_tags(str_ireplace("
","\n",$string),$allow)),ENT_QUOTES,'UTF-8'); } /** @@ -857,9 +857,9 @@ function QueXMLFixedArray($array) { $category = $dom->createElement("category"); - $label = $dom->createElement("label",QueXMLCleanup("$key")); + $label = $dom->createElement("label",QueXMLCleanup("$key",'')); - $value= $dom->createElement("value",QueXMLCleanup("$v")); + $value= $dom->createElement("value",QueXMLCleanup("$v",'')); $category->appendChild($label); $category->appendChild($value); @@ -914,7 +914,7 @@ function QueXMLCreateFixed($qid,$rotate=false,$labels=true,$scale=0,$other=false { $category = $dom->createElement("category"); - $label = $dom->createElement("label",QueXMLCleanup($Row['title'])); + $label = $dom->createElement("label",QueXMLCleanup($Row['title'],'')); $value= $dom->createElement("value",QueXMLCleanup($Row['code'])); @@ -1008,7 +1008,7 @@ function quexml_create_multi(&$question,$qid,$varname,$scale_id = false,$free = $fixed = $dom->createElement("fixed"); $category = $dom->createElement("category"); - $label = $dom->createElement("label",QueXMLCleanup($Row['question'])); + $label = $dom->createElement("label",QueXMLCleanup($Row['question'],'')); $value= $dom->createElement("value",1); $nextcode = $Row['title']; @@ -1095,7 +1095,7 @@ function quexml_create_subQuestions(&$question,$qid,$varname,$use_answers = fals foreach($QueryResult->readAll() as $Row) { $subQuestion = $dom->createElement("subQuestion"); - $text = $dom->createElement("text",QueXMLCleanup($Row['question'])); + $text = $dom->createElement("text",QueXMLCleanup($Row['question'],'')); $subQuestion->appendChild($text); $subQuestion->setAttribute("varName",$varname . QueXMLCleanup($Row['title'])); $question->appendChild($subQuestion);