Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-18 10:41:46 +0300
committerJoas Schilling <coding@schilljs.com>2020-06-29 16:50:20 +0300
commit8e900c3ef820b1665a51b7a1e4d9a985413e3f3c (patch)
treeaa918cb8aa4da960844c418dd4db5266927f6d3e /lib/Service/RoomService.php
parent9432b91b281416f15c626750ac1ba2d1033d49ff (diff)
Also throw on invalid object data
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Service/RoomService.php')
-rw-r--r--lib/Service/RoomService.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Service/RoomService.php b/lib/Service/RoomService.php
index 2960cbaed..cee119c8e 100644
--- a/lib/Service/RoomService.php
+++ b/lib/Service/RoomService.php
@@ -91,6 +91,21 @@ class RoomService {
throw new InvalidArgumentException('type');
}
+ $objectType = trim($objectType);
+ if (isset($objectType[64])) {
+ throw new InvalidArgumentException('object_type');
+ }
+
+ $objectId = trim($objectId);
+ if (isset($objectId[64])) {
+ throw new InvalidArgumentException('object_id');
+ }
+
+ if (($objectType !== '' && $objectId === '') ||
+ ($objectType === '' && $objectId !== '')) {
+ throw new InvalidArgumentException('object');
+ }
+
$room = $this->manager->createRoom($type, $name, $objectType, $objectId);
if ($owner instanceof IUser) {