diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-11-16 11:22:45 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-11-16 11:22:45 -0500 |
commit | 717758563038e802976fbd5fcdede45804b82c51 (patch) | |
tree | 3ace254aabbfcdd68c0494047e417377e8f3d614 | |
parent | 73b4d770a2551018ea17d115d980972dc5f0865a (diff) |
getGroups was not handling the case where limit=null correctly
-rw-r--r-- | classes/User.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/classes/User.php b/classes/User.php index 9f1ee53f4..4ddf94916 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; + } } } |