Skip to content
Snippets Groups Projects
Commit 2b8a2e16 authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

LDAP: don't pass -1 as length to array slice, when no limit is given. It cuts off the last item.

parent ac9fd793
No related branches found
No related tags found
No related merge requests found
...@@ -143,6 +143,9 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { ...@@ -143,6 +143,9 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
if(!empty($this->groupSearch)) { if(!empty($this->groupSearch)) {
$groupUsers = array_filter($groupUsers, array($this, 'groupMatchesFilter')); $groupUsers = array_filter($groupUsers, array($this, 'groupMatchesFilter'));
} }
if($limit = -1) {
$limit = null;
}
return array_slice($groupUsers, $offset, $limit); return array_slice($groupUsers, $offset, $limit);
} }
...@@ -184,6 +187,9 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { ...@@ -184,6 +187,9 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
if(!empty($this->groupSearch)) { if(!empty($this->groupSearch)) {
$groupUsers = array_filter($groupUsers, array($this, 'groupMatchesFilter')); $groupUsers = array_filter($groupUsers, array($this, 'groupMatchesFilter'));
} }
if($limit = -1) {
$limit = null;
}
return array_slice($groupUsers, $offset, $limit); return array_slice($groupUsers, $offset, $limit);
} }
...@@ -210,6 +216,9 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { ...@@ -210,6 +216,9 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
if(!empty($this->groupSearch)) { if(!empty($this->groupSearch)) {
$ldap_groups = array_filter($ldap_groups, array($this, 'groupMatchesFilter')); $ldap_groups = array_filter($ldap_groups, array($this, 'groupMatchesFilter'));
} }
if($limit = -1) {
$limit = null;
}
return array_slice($ldap_groups, $offset, $limit); return array_slice($ldap_groups, $offset, $limit);
} }
......
...@@ -111,6 +111,9 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface { ...@@ -111,6 +111,9 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
if(!empty($this->userSearch)) { if(!empty($this->userSearch)) {
$ldap_users = array_filter($ldap_users, array($this, 'userMatchesFilter')); $ldap_users = array_filter($ldap_users, array($this, 'userMatchesFilter'));
} }
if($limit = -1) {
$limit = null;
}
return array_slice($ldap_users, $offset, $limit); return array_slice($ldap_users, $offset, $limit);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment