Skip to content

Commit

Permalink
Fix GridField CSV export value escaping
Browse files Browse the repository at this point in the history
Gridfield export of summary fields incorrectly escapes `'`and `"`, breaks CSV format. See silverstripe#10657
  • Loading branch information
axllent committed Jan 26, 2023
1 parent 62f71a3 commit fe77d4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Forms/GridField/GridFieldExportButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ public function generateExportFileData($gridField)
$value = $columnHeader($relObj);
} elseif ($gridFieldColumnsComponent && in_array($columnSource, $columnsHandled ?? [])) {
$value = strip_tags(
$gridFieldColumnsComponent->getColumnContent($gridField, $item, $columnSource) ?? ''
html_entity_decode(
$gridFieldColumnsComponent->getColumnContent($gridField, $item, $columnSource),
ENT_QUOTES
) ?? ''
);
} else {
$value = $gridField->getDataFieldValue($item, $columnSource);
Expand Down

0 comments on commit fe77d4e

Please sign in to comment.