Fix result new lines

This commit is contained in:
Sven Seeberg 2020-10-29 17:06:16 +01:00
parent b73c989b00
commit 24848c2199
Signed by: sven.seeberg
GPG key ID: 29559DD5A83806B5

View file

@ -102,10 +102,10 @@ function create_text_file($cfg, $body) {
$file_path = $cfg["export"]["path"] . "/" . date('Y-m-d') . "__" . str_replace(" ", "_", $body->event_title) . "__" . $body->vote_round . ".txt";
$header = "\n\n" . create_header($cfg, $body) .
"\n\nAbstimm-ID | Stimme(n)" .
"\n----------------------------------------------------------------------------";
"\n----------------------------------------------------------------------------\n";
file_put_contents($file_path, $header);
foreach ($body->votes as $vote) {
$line = $vote->hash . " | " . implode(", ", $vote->vote);
$line = $vote->hash . " | " . implode(", ", $vote->vote) . "\n";
file_put_contents($file_path, $line, FILE_APPEND);
}
shell_exec("gpg --yes --output " . $file_path . " --clearsign " . $file_path);