fix no column problem

This commit is contained in:
Christian Staudte 2020-11-19 20:27:38 +01:00
parent 76190838df
commit 8aa9411129
Signed by: christian.staudte
GPG key ID: 88ED5070FE0D5F23

View file

@ -210,8 +210,10 @@ EOT;
foreach ($body->votes as $vote)
if (count($vote->vote) > $col_count)
$col_count = count($vote->vote);
// if no columns (or too many), stop the pdf process
if ($col_count < 1 || $col_count > 5)
throw new Exception('Too many or no vote columns');
return '';
// build the table header variables
$table_col_count = str_repeat('|l', $col_count);
@ -267,13 +269,13 @@ EOT;
unlink("$ffull.aux");
// TODO: sign the pdf file
shell_exec("");
//shell_exec("");
// synchronize the file
$this->sync_command("$ffull.pdf");
// return the hash of the file
return trim(shell_exec("/usr/bin/sha256sum $file_path | awk '{ print $1 }'"));
return trim(shell_exec("/usr/bin/sha256sum '$file_path' | awk '{ print $1 }'"));
}
/**