diff --git a/.github/workflows/phpunit-sqlite.yml b/.github/workflows/phpunit-sqlite.yml index e5bdb0215..38502105c 100644 --- a/.github/workflows/phpunit-sqlite.yml +++ b/.github/workflows/phpunit-sqlite.yml @@ -107,7 +107,7 @@ jobs: php-version: ${{ matrix.php-versions }} # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite - coverage: none + coverage: xdebug ini-file: development # Temporary workaround for missing pcntl_* in PHP 8.3 ini-values: disable_functions= diff --git a/lib/Service/SubmissionService.php b/lib/Service/SubmissionService.php index baea59590..38a81bf1b 100644 --- a/lib/Service/SubmissionService.php +++ b/lib/Service/SubmissionService.php @@ -311,11 +311,12 @@ private function exportData(array $header, array $data, string $fileFormat, ?Fil ->getAlignment() ->setWrapText(true); } else { - $activeWorksheet->setCellValue([$column, $row], $value); - - // Quote cell values that start with '=' to prevent evaluation of formulas + // Explicitly set the type of the value to string for values that start with '=' to prevent it being interpreted as formulas if (is_string($value) && str_starts_with($value, '=')) { - $activeWorksheet->getCell([$column, $row])->getStyle()->setQuotePrefix(true); + $activeWorksheet->getCell([$column, $row]) + ->setValueExplicit($value); + } else { + $activeWorksheet->setCellValue([$column, $row], $value); } } }