diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2024-09-15 21:23:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-15 21:23:53 +0200 |
commit | 9561834b9652a154efcb80fdb0f7e00c1445ddd7 (patch) | |
tree | b9b5acb176ef8a3d21b20403b1ce931f02e4b009 /apps | |
parent | 9686d41a5eca1093d5800bc0896301a4457d4f5d (diff) | |
parent | f4990d7cd5c0f424e8d27da31e65a4bb1adb653e (diff) | |
download | nextcloud-server-9561834b9652a154efcb80fdb0f7e00c1445ddd7.tar.gz nextcloud-server-9561834b9652a154efcb80fdb0f7e00c1445ddd7.zip |
Merge pull request #47919 from nextcloud/backport/47914/stable30
[stable30] fix(LDAP): check index before accessing it
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/lib/Access.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index b8bee8a3ef7..a4b4650810c 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -255,20 +255,19 @@ class Access extends LDAPUtility { * @return array If a range was detected with keys 'values', 'attributeName', * 'attributeFull' and 'rangeHigh', otherwise empty. */ - public function extractRangeData($result, $attribute) { + public function extractRangeData(array $result, string $attribute): array { $keys = array_keys($result); foreach ($keys as $key) { if ($key !== $attribute && str_starts_with((string)$key, $attribute)) { $queryData = explode(';', (string)$key); - if (str_starts_with($queryData[1], 'range=')) { + if (isset($queryData[1]) && str_starts_with($queryData[1], 'range=')) { $high = substr($queryData[1], 1 + strpos($queryData[1], '-')); - $data = [ + return [ 'values' => $result[$key], 'attributeName' => $queryData[0], 'attributeFull' => $key, 'rangeHigh' => $high, ]; - return $data; } } } |