]> git.proxmox.com Git - pve-common.git/commit
fix #4778: fix boolean type check for json parameters over the api
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 15 Jun 2023 12:36:43 +0000 (14:36 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 15 Jun 2023 12:58:56 +0000 (14:58 +0200)
commitbc24aad31684d2cb731a940d5ed076ee37d70d38
tree4bcae9532045a9056e4c3158f1c80c34698a8108
parentd4218592e562a9914aa6491c0647858646688931
fix #4778: fix boolean type check for json parameters over the api

if a real json boolean is sent via the api, $value is a
JSON::PP::Boolean here instead of a string/scalar

so we should validate that too

the $value itself can be used normally in conditions like
----
if ($value) {
----

if the value is stringified, the result is either '1' or '0' so even if
we have some explicit checks like that it should not make a problem

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/JSONSchema.pm