mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 16:38:32 +00:00
Validate inc/dec operation value is numeric
This commit is contained in:
parent
eb7306a4fa
commit
066e0bc236
1 changed files with 5 additions and 0 deletions
|
|
@ -202,6 +202,11 @@ class Operation extends Validator
|
|||
$this->description = "Key '{$attributeKey}' is required in data for {$action}";
|
||||
return false;
|
||||
}
|
||||
// Validate 'value' is numeric if provided (defaults to 1 if omitted)
|
||||
if (\array_key_exists('value', $value['data']) && !\is_numeric($value['data']['value'])) {
|
||||
$this->description = "Key 'value' must be a numeric value for {$action}";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue