From 6b313c5af225aefcf258777d9914b940e69cea99 Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Wed, 3 Nov 2021 10:29:42 +0530 Subject: [PATCH] Fix #333: Correct `stripHtml` --- CHANGE.md | 1 + src/ExportMenu.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGE.md b/CHANGE.md index b220580..29db77b 100755 --- a/CHANGE.md +++ b/CHANGE.md @@ -6,6 +6,7 @@ Change Log: `yii2-export` **Date:** 03-Nov-2021 - (enh #353): Enhancements to support Bootstrap v5.x. +- (enh #333): Correct `stripHtml`. - (enh #330): Sanitize file names in a better way. - (enh #328, #329): Allow closure for contentOptions. diff --git a/src/ExportMenu.php b/src/ExportMenu.php index 46afb0c..bf94ae2 100644 --- a/src/ExportMenu.php +++ b/src/ExportMenu.php @@ -2149,10 +2149,10 @@ protected function setHttpHeaders() */ protected function setOutCellValue($sheet, $index, $value, $format = null) { + $value = html_entity_decode($value, ENT_QUOTES, 'UTF-8'); if ($this->stripHtml) { $value = strip_tags($value); } - $value = html_entity_decode($value, ENT_QUOTES, 'UTF-8'); $cell = $sheet->getCell($index); if ($format === null) { $cell->setValue($value);