Skip to content

Commit c745e16

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

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/Service/SubmissionService.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ private function exportData(array $header, array $data, string $fileFormat, ?Fil
312312
->setWrapText(true);
313313
} else {
314314
$activeWorksheet->setCellValue([$column, $row], $value);
315+
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+
}
315320
}
316321
}
317322
}

0 commit comments

Comments
 (0)