mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
fix: reject unsupported relationship value types
This commit is contained in:
parent
d792d3bbea
commit
d182c85330
1 changed files with 2 additions and 0 deletions
|
|
@ -264,6 +264,8 @@ abstract class Action extends DatabasesAction
|
||||||
$relationId = $relation;
|
$relationId = $relation;
|
||||||
} elseif (\is_array($relation) && \array_values($relation) !== $relation) {
|
} elseif (\is_array($relation) && \array_values($relation) !== $relation) {
|
||||||
$relationId = $relation['$id'] ?? null;
|
$relationId = $relation['$id'] ?? null;
|
||||||
|
} else {
|
||||||
|
throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Relationship value must be an object, document ID string, or associative array');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($relationId !== null) {
|
if ($relationId !== null) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue