From 93fb74503d448e621dbee850a7738d0a7ec21bb0 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 7 Dec 2020 14:30:52 +0100 Subject: [PATCH] limit number of returned rows on link query by default to 100 --- api/src/Link.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/src/Link.php b/api/src/Link.php index 87e84ee3bf..6ebdfba2be 100644 --- a/api/src/Link.php +++ b/api/src/Link.php @@ -769,6 +769,11 @@ class Link extends Link\Storage return $apps; } + /** + * Default number of returned rows for Link::query() + */ + const DEFAULT_NUM_ROWS = 100; + /** * Searches for a $pattern in the entries of $app * @@ -790,6 +795,8 @@ class Link extends Link\Storage echo "

Link::query('$app','$pattern') => '$method'

\n"; echo "Options: "; _debug_array($options); } + // limit number of returned rows by default to 100, if no limit is set + if (!isset($options['num_rows'])) $options['num_rows'] = self::DEFAULT_NUM_ROWS; $result = self::exec($method, array($pattern, &$options));