summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-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;
+ }
}
}