Skip to content

Commit

Permalink
Merge pull request #453 from boxwise/hotfix/add-comments-for-allowanc…
Browse files Browse the repository at this point in the history
…e-of-zero-amount

Add comments for allowance of zero amount in the "Given Token to All"
  • Loading branch information
HaGuesto authored Dec 6, 2021
2 parents 45e6cd4 + 27b1fc4 commit 5e2da25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/give2all.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
db_query('INSERT INTO ration (startration) VALUES (NOW())');
}
*/
// validate tokens input value

// Validate tokens input value to be a valid integer
// Allowance for 0 is specifically for the "reset tokens" feature, as requested by Darbazar
// Related to https://trello.com/c/Um44yV7y
if (!preg_match('/[0-9]\d*/', $_POST['dropsadult']) || !preg_match('/[0-9]\d*/', $_POST['dropschild'])) {
redirect('?action=give2all&warning=1&message=The number of tokens should be specified');
trigger_error('The number of tokens should be specified', E_USER_NOTICE);
Expand Down

0 comments on commit 5e2da25

Please sign in to comment.