From: Craig Andrews <candrews@integralblue.com>
Date: Mon, 16 Nov 2009 16:22:45 +0000 (-0500)
Subject: getGroups was not handling the case where limit=null correctly
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=717758563038e802976fbd5fcdede45804b82c51;p=quix0rs-gnu-social.git

getGroups was not handling the case where limit=null correctly
---

diff --git a/classes/User.php b/classes/User.php
index 9f1ee53f48..4ddf949166 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -577,11 +577,13 @@ class User extends Memcached_DataObject
           'WHERE group_member.profile_id = %d ' .
           'ORDER BY group_member.created DESC ';
 
-        if ($offset) {
-            if (common_config('db','type') == 'pgsql') {
-                $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
-            } else {
-                $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+        if ($offset>0 && !is_null($limit)) {
+            if ($offset) {
+                if (common_config('db','type') == 'pgsql') {
+                    $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
+                } else {
+                    $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+                }
             }
         }