fix(comments): Put a limit to the limit

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling
2026-01-13 16:25:07 +01:00
parent 7a0093c163
commit af33953078

View File

@@ -157,6 +157,7 @@ class CommentsPlugin extends ServerPlugin {
if (!is_null($args['datetime'])) {
$args['datetime'] = new \DateTime((string)$args['datetime']);
}
$args['limit'] = min(max(1, $args['limit']), 100);
$results = $node->findChildren($args['limit'], $args['offset'], $args['datetime']);