From 717758563038e802976fbd5fcdede45804b82c51 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 16 Nov 2009 11:22:45 -0500 Subject: [PATCH] getGroups was not handling the case where limit=null correctly --- classes/User.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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; + } } } -- 2.39.5