summaryrefslogtreecommitdiff
path: root/classes/User.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-11-16 11:22:45 -0500
committerCraig Andrews <candrews@integralblue.com>2009-11-16 11:22:45 -0500
commit717758563038e802976fbd5fcdede45804b82c51 (patch)
tree3ace254aabbfcdd68c0494047e417377e8f3d614 /classes/User.php
parent73b4d770a2551018ea17d115d980972dc5f0865a (diff)
getGroups was not handling the case where limit=null correctly
Diffstat (limited to 'classes/User.php')
-rw-r--r--classes/User.php12
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;
+ }
}
}