Adding input check for AP and Donation

Fixes #354
This commit is contained in:
Sebastian Grewe 2013-07-04 12:42:03 +02:00
parent 37b97de828
commit 8056ce9f87

View File

@ -282,14 +282,20 @@ class User {
$bUser = false;
// number validation checks
if ($threshold < $this->config['ap_threshold']['min'] && $threshold != 0) {
if (!is_numeric($threshold)) {
$this->setErrorMessage('Invalid input for auto-payout');
return false;
} else if ($threshold < $this->config['ap_threshold']['min'] && $threshold != 0) {
$this->setErrorMessage('Threshold below configured minimum of ' . $this->config['ap_threshold']['min']);
return false;
} else if ($threshold > $this->config['ap_threshold']['max']) {
$this->setErrorMessage('Threshold above configured maximum of ' . $this->config['ap_threshold']['max']);
return false;
}
if ($donate < 0) {
if (!is_numeric($donate)) {
$this->setErrorMessage('Invalid input for donation');
return false;
} else if ($donate < 0) {
$this->setErrorMessage('Donation below allowed 0% limit');
return false;
} else if ($donate > 100) {