fix(web/html/addvote): convert quorum to str using strval

Previous conversion was causing a straight up bug when submitting
new proposals. This patch fixes that issue.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-01-06 15:29:40 -08:00
parent 059733cb8c
commit d49886f44f
No known key found for this signature in database
GPG key ID: F7E46DED420788F3

View file

@ -69,9 +69,8 @@ if (has_credential(CRED_TU_ADD_VOTE)) {
if (!empty($_POST['addVote']) && empty($error)) { if (!empty($_POST['addVote']) && empty($error)) {
// Convert $quorum to a String of maximum length "12.34" (5). // Convert $quorum to a String of maximum length "12.34" (5).
$quorum_str = substr(strval($quorum), min(5, strlen($quorum)));
add_tu_proposal($_POST['agenda'], $_POST['user'], add_tu_proposal($_POST['agenda'], $_POST['user'],
$len, $quorum_str, $uid); $len, strval($quorum), $uid);
print "<p class=\"pkgoutput\">" . __("New proposal submitted.") . "</p>\n"; print "<p class=\"pkgoutput\">" . __("New proposal submitted.") . "</p>\n";
} else { } else {