aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-08-31 17:00:19 +0200
committerprovokateurin <kate@provokateurin.de>2024-09-10 16:36:33 +0200
commitd0a827a68430cf716f098b0238a150c2fd9e4c83 (patch)
treeecc4ce85e6d2a2b0253f6542f5e902af682aaad7 /lib
parent0858ff7a076b1535cecd7c1ec5140b4e2c2b4f47 (diff)
downloadnextcloud-server-d0a827a68430cf716f098b0238a150c2fd9e4c83.tar.gz
nextcloud-server-d0a827a68430cf716f098b0238a150c2fd9e4c83.zip
fix(RichObjectStrings/Validator): Validate key value types of rich object parameters
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/RichObjectStrings/Validator.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/RichObjectStrings/Validator.php b/lib/private/RichObjectStrings/Validator.php
index 41c2456ba27..197f48ed48c 100644
--- a/lib/private/RichObjectStrings/Validator.php
+++ b/lib/private/RichObjectStrings/Validator.php
@@ -78,6 +78,15 @@ class Validator implements IValidator {
if (!empty($missingKeys)) {
throw new InvalidObjectExeption('Object is invalid, missing keys:'.json_encode($missingKeys));
}
+
+ foreach ($parameter as $key => $value) {
+ if (!is_string($key)) {
+ throw new InvalidObjectExeption('Object is invalid, key ' . $key . ' is not a string');
+ }
+ if (!is_string($value)) {
+ throw new InvalidObjectExeption('Object is invalid, value ' . $value . ' is not a string');
+ }
+ }
}
/**