Skip to content

v5.17.0

Latest

Choose a tag to compare

@elminson elminson released this 08 Sep 17:03
0be28cb

headerRow()

startRow() alone used to double as the header row too, so reading a file starting anywhere but row 1 lost the real headers — the first data row got used as the header names instead. headerRow() decouples the two.

$rows = (new FastExcel())->headerRow(1)->startRow(4)->import('file.xlsx');

This is also what makes chunked imports work cleanly: every chunk can read the same header row while sliding its own startRow()/limitRows() window over the data. startRow() on its own keeps its historical meaning, so nothing breaks for existing callers.

Fixes #349, reported by @MaarekVarres.

escapeFormulas()

Cell values starting with =, +, - or @ are treated as formulas by Excel and other spreadsheet software, which can silently execute unintended content when a file is opened. escapeFormulas() writes those values as plain text instead.

(new FastExcel($rows))->escapeFormulas()->export('file.xlsx');

Fixes #356, reported by @LauKL1991. Thanks also to @ariprw and @gmutinel, whose '-prefix workarounds on the issue shaped the fix.


Thanks to @dannyyol for reviewing both of these.

Full changelog: v5.16.0...v5.17.0