Skip to content

Commit

Permalink
Fixed issue #09458: Under specific condition : HTMLPurifier inserts !…
Browse files Browse the repository at this point in the history
… characters at random into emailed surveys

Dev: No need complete HTML for answer table . Maybe just have question code can be better.
  • Loading branch information
Shnoulle committed Feb 2, 2015
1 parent f33f2a3 commit 77ae8e3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions application/helpers/frontend_helper.php
Expand Up @@ -693,17 +693,17 @@ function sendSubmitNotifications($surveyid)
{
if (substr($sFieldname,0,4)=='gid_')
{
$ResultTableHTML .= "\t<tr class='printanswersgroup'><td colspan='2'>{$fname[0]}</td></tr>\n";
$ResultTableHTML .= "\t<tr class='printanswersgroup'><td colspan='2'>".strip_tags($fname[0])."</td></tr>\n";
$ResultTableText .="\n{$fname[0]}\n\n";
}
elseif (substr($sFieldname,0,4)=='qid_')
{
$ResultTableHTML .= "\t<tr class='printanswersquestionhead'><td colspan='2'>{$fname[0]}</td></tr>\n";
$ResultTableHTML .= "\t<tr class='printanswersquestionhead'><td colspan='2'>".strip_tags($fname[0])."</td></tr>\n";
$ResultTableText .="\n{$fname[0]}\n";
}
else
{
$ResultTableHTML .= "\t<tr class='printanswersquestion'><td>{$fname[0]} {$fname[1]}</td><td class='printanswersanswertext'>".CHtml::encode($fname[2])."</td></tr>\n";
$ResultTableHTML .= "\t<tr class='printanswersquestion'><td>".strip_tags("{$fname[0]} {$fname[1]}")."</td><td class='printanswersanswertext'>".CHtml::encode($fname[2])."</td></tr>\n";
$ResultTableText .=" {$fname[0]} {$fname[1]}: {$fname[2]}\n";
}
}
Expand All @@ -712,8 +712,7 @@ function sendSubmitNotifications($surveyid)
$ResultTableText .= "\n\n";
if ($bIsHTML)
{
$filter = new CHtmlPurifier();
$aReplacementVars['ANSWERTABLE']=$filter->purify($ResultTableHTML);
$aReplacementVars['ANSWERTABLE']=$ResultTableHTML;
}
else
{
Expand Down

0 comments on commit 77ae8e3

Please sign in to comment.