Skip to content

Commit 94c94c5

Browse files
committed
Strip tags column title when exporting.
1 parent f3a3e13 commit 94c94c5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Transformers/DataTransformer.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ protected function buildColumnByCollection(array $row, Collection $columns, $ty
4141
$results = [];
4242
foreach ($columns->all() as $column) {
4343
if ($column[$type]) {
44-
$data = array_get($row, $column['data']);
44+
$title = $column['title'];
45+
$data = array_get($row, $column['data']);
46+
if ($type == 'exportable') {
47+
$data = e(strip_tags($data));
48+
$title = e(strip_tags($title));
49+
}
4550

46-
$results[$column['title']] = $type == 'exportable' ? e(strip_tags($data)) : $data;
51+
$results[$title] = $data;
4752
}
4853
}
4954

0 commit comments

Comments
 (0)