From 8aa9411129e0d88c14627ce0048f788a05f9ea72 Mon Sep 17 00:00:00 2001 From: Christian Staudte Date: Thu, 19 Nov 2020 20:27:38 +0100 Subject: [PATCH] fix no column problem --- functions.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/functions.php b/functions.php index 65a3718..2bb3c94 100644 --- a/functions.php +++ b/functions.php @@ -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 }'")); } /**