aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorKate <26026535+provokateurin@users.noreply.github.com>2024-09-10 17:40:46 +0200
committerGitHub <noreply@github.com>2024-09-10 17:40:46 +0200
commit979cc8712cfe090d01508a8cd56eca04e2d9f1c8 (patch)
tree4ea36bdee4428e768a5b3fbbbd36a35561298156 /lib/private
parenta7eaed721c477230176b0689cfcc2c1c7b458ec3 (diff)
parenta3da7456a7b4872cf788b6d853e792d83af7b505 (diff)
downloadnextcloud-server-979cc8712cfe090d01508a8cd56eca04e2d9f1c8.tar.gz
nextcloud-server-979cc8712cfe090d01508a8cd56eca04e2d9f1c8.zip
Merge pull request #47662 from nextcloud/fix/notification/validate-rich-object-key-value-types
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Activity/Event.php4
-rw-r--r--lib/private/RichObjectStrings/Validator.php9
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/private/Activity/Event.php b/lib/private/Activity/Event.php
index 97ab7d1c935..02cfd758058 100644
--- a/lib/private/Activity/Event.php
+++ b/lib/private/Activity/Event.php
@@ -259,7 +259,7 @@ class Event implements IEvent {
}
/**
- * @return array[]
+ * @return array<string, array<string, string>>
* @since 11.0.0
*/
public function getRichSubjectParameters(): array {
@@ -335,7 +335,7 @@ class Event implements IEvent {
}
/**
- * @return array[]
+ * @return array<string, array<string, string>>
* @since 11.0.0
*/
public function getRichMessageParameters(): array {
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');
+ }
+ }
}
/**