Skip to content

Commit 5f84f19

Browse files
committed
fix: quote cell values to prevent formula evaluation
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent 0fb87f0 commit 5f84f19

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/Service/SubmissionService.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ private function exportData(array $header, array $data, string $fileFormat, ?Fil
313313
} else {
314314
$activeWorksheet->setCellValue([$column, $row], $value);
315315
}
316+
// Quote cell values that start with '=' to prevent evaluation of formulas
317+
if (is_string($value) && str_starts_with($value, '=')) {
318+
$activeWorksheet->getCell([$column, $row])->getStyle()->setQuotePrefix(true);
319+
}
316320
}
317321
}
318322

0 commit comments

Comments
 (0)