Skip to content

Commit

Permalink
Fixed issue [security] #16396: Multiple self-stored XSS in printanswer
Browse files Browse the repository at this point in the history
Dev: Add answercode for testing if other (-oth-)
Dev: fix other : single choice and multiple choice
Dev: div fix comments on multiple with comments
Dev: list with comment not fixed (comment are not shown …)
  • Loading branch information
Shnoulle committed Jun 18, 2020
1 parent 98cd4f3 commit afcb657
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions application/models/SurveyDynamic.php
Expand Up @@ -864,6 +864,7 @@ public function getQuestionArray($oQuestion, $oResponses, $bHonorConditions, $su
$aQuestionAttributes['dateformat'] = getDateFormatDataForQID($aQuestionAttributes, array_merge(self::$survey->attributes, $oQuestion->survey->languagesettings[$oQuestion->language]->attributes));
}
$aQuestionAttributes['answervalue'] = isset($oResponses[$fieldname]) ? $oResponses[$fieldname] : null;
$aQuestionAttributes['answercode'] = $aQuestionAttributes['answervalue']; // Must keep original code for -oth- and maybe other
if ((in_array($oQuestion->type, ["!", "L", "O", "F", "H"]))
|| ($oQuestion->type=='T' && $oQuestion->parent_qid != 0) ) {

Expand Down
Expand Up @@ -5,7 +5,12 @@
<div class="col-md-4 text-right">
</div>
<div class="col-md-8 text-left">
{{question.answervalue}} - {{question.answeroption.answer}}
{{question.answervalue}} -
{% if question.answercode == '-oth-' %}
{{question.answeroption.answer|escape}}
{% else %}
{{question.answeroption.answer}}
{%endif %}
</div>
</div>
</div>
Expand Down
Expand Up @@ -3,7 +3,11 @@
<div class="col-md-8">
<div class="row">
<div class="col-md-4 text-right">
{{question.answeroption.answer}}
{% if question.answercode == '-oth-' %}
{{question.answeroption.answer|escape}}
{% else %}
{{question.answeroption.answer}}
{%endif %}
</div>
<div class="col-md-8 text-left">
<b>{{question.answervalue}}</b>
Expand Down
Expand Up @@ -7,14 +7,14 @@
{% if subquestion.answervalue is sameas("Y") %}
<i class="fa fa-check-square-o"></i>
{% else %}
{{subquestion.answervalue}}
{{subquestion.answervalue|escape}}
{% endif %}
</div>
<div class="col-md-4 text-left">
<b>{{subquestion.question}} ({{subquestion.qid}})</b>
</div>
<div class="col-md-4 text-left">
{{subquestion.comment.answervalue}}
{{subquestion.comment.answervalue|escape}}
</div>
</div>
{% endfor %}
Expand Down
Expand Up @@ -7,7 +7,7 @@
{% if subquestion.answervalue is sameas("Y") %}
<i class="fa fa-check-square-o"></i>
{% else %}
{{subquestion.answervalue}}
{{subquestion.answervalue|escape}}
{% endif %}
</div>
<div class="col-md-8 text-left">
Expand Down

0 comments on commit afcb657

Please sign in to comment.