MDL-31366 Feedback: decode htmlchars on output to excel
authorDan Marsden <dan@danmarsden.com>
Fri, 11 Jul 2014 01:24:05 +0000 (13:24 +1200)
committerDan Marsden <dan@danmarsden.com>
Fri, 11 Jul 2014 01:28:16 +0000 (13:28 +1200)
mod/feedback/item/textarea/lib.php
mod/feedback/item/textfield/lib.php

index 304e5d7..e086e12 100644 (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++;
             }
         }
index ccbf806..77027c1 100644 (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++;
             }
         }