strip_tags for CSV headers
shopapps opened this issue · 0 comments
shopapps commented
I have created a pull request for this, but i noticed if the label for a column contains HTML this gets passed into the CSV.
editing line 133 of FilamentExport.php
and adding strip_tags helps stop this:
$headers = $this->getAllColumns()->map(fn ($column) => strip_tags($column->getLabel()))->toArray();
In the PR i also added the option to request $state to receive the original value of a given row when using (see README.md for examples)
FilamentExportHeaderAction::make('export')->label(__('Export'))
->formatStates([
'last_name' => fn(string $state) :string => $state, // returns raw value
]);