Skip to content

Commit 55a6a99

Browse files
committed
Fix limit in api
1 parent f3f7bcb commit 55a6a99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

class/api_sellyoursaas.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
223223
$i = 0;
224224
if ($result) {
225225
$num = $this->db->num_rows($result);
226-
while ($i < $num) {
226+
$min = min($num, ($limit <= 0 ? $num : $limit));
227+
while ($i < $min) {
227228
$obj = $this->db->fetch_object($result);
228229
$tmp_object = new Packages($this->db);
229230
if ($tmp_object->fetch($obj->rowid)) {

0 commit comments

Comments
 (0)