diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-10-08 09:58:11 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-10-08 09:58:11 -0400 |
commit | c2f1cc8f7419fe4eb5e9bd5e6ce05d90e719be17 (patch) | |
tree | 93900cc242574a346f14e2002f050b5f2c7dc55e /app/Validator | |
parent | 1466afb771f0291bc350441aede14c97459128e7 (diff) |
Restrict task complexity to a specific range to avoid integer overflow
Diffstat (limited to 'app/Validator')
-rw-r--r-- | app/Validator/TaskValidator.php | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/app/Validator/TaskValidator.php b/app/Validator/TaskValidator.php index 8aa5c440..e3b0eded 100644 --- a/app/Validator/TaskValidator.php +++ b/app/Validator/TaskValidator.php @@ -28,6 +28,7 @@ class TaskValidator extends BaseValidator new Validators\Integer('owner_id', t('This value must be an integer')), new Validators\Integer('creator_id', t('This value must be an integer')), new Validators\Integer('score', t('This value must be an integer')), + new Validators\Range('score', t('This value must be in the range %d to %d', -2147483647, 2147483647), -2147483647, 2147483647), new Validators\Integer('category_id', t('This value must be an integer')), new Validators\Integer('swimlane_id', t('This value must be an integer')), new Validators\Integer('recurrence_child', t('This value must be an integer')), @@ -96,27 +97,6 @@ class TaskValidator extends BaseValidator } /** - * Validate description creation - * - * @access public - * @param array $values Form values - * @return array $valid, $errors [0] = Success or not, [1] = List of errors - */ - public function validateDescriptionCreation(array $values) - { - $rules = array( - new Validators\Required('id', t('The id is required')), - ); - - $v = new Validator($values, array_merge($rules, $this->commonValidationRules())); - - return array( - $v->execute(), - $v->getErrors() - ); - } - - /** * Validate edit recurrence * * @access public |