MDL-31366 Feedback: decode htmlchars on output to excel

This commit is contained in:
Dan Marsden 2014-07-11 13:24:05 +12:00
parent 5fd0df97c5
commit 9b4162fb1d
2 changed files with 4 additions and 4 deletions

View File

@ -177,12 +177,12 @@ class feedback_item_textarea extends feedback_item_base {
$data = $analysed_item->data;
if (is_array($data)) {
if (isset($data[0])) {
$worksheet->write_string($row_offset, 2, $data[0], $xls_formats->value_bold);
$worksheet->write_string($row_offset, 2, htmlspecialchars_decode($data[0], ENT_QUOTES), $xls_formats->value_bold);
}
$row_offset++;
$sizeofdata = count($data);
for ($i = 1; $i < $sizeofdata; $i++) {
$worksheet->write_string($row_offset, 2, $data[$i], $xls_formats->default);
$worksheet->write_string($row_offset, 2, htmlspecialchars_decode($data[$i], ENT_QUOTES), $xls_formats->default);
$row_offset++;
}
}

View File

@ -167,11 +167,11 @@ class feedback_item_textfield extends feedback_item_base {
$worksheet->write_string($row_offset, 1, $item->name, $xls_formats->head2);
$data = $analysed_item->data;
if (is_array($data)) {
$worksheet->write_string($row_offset, 2, $data[0], $xls_formats->value_bold);
$worksheet->write_string($row_offset, 2, htmlspecialchars_decode($data[0], ENT_QUOTES), $xls_formats->value_bold);
$row_offset++;
$sizeofdata = count($data);
for ($i = 1; $i < $sizeofdata; $i++) {
$worksheet->write_string($row_offset, 2, $data[$i], $xls_formats->default);
$worksheet->write_string($row_offset, 2, htmlspecialchars_decode($data[$i], ENT_QUOTES), $xls_formats->default);
$row_offset++;
}
}