aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>2023-11-16 02:50:09 +0100
committerGitHub <noreply@github.com>2023-11-16 02:50:09 +0100
commitae31d0321715deac7f2f5db3253f75d58deecf4e (patch)
tree6319dbf475e2f36295e11691bdbd935abaacd433 /lib
parent0d4ece537ab667925d6f1aa0a155610e9bc9e063 (diff)
parent33837e7d6fb57d657a197a4f49549d919b1ebc62 (diff)
downloadnextcloud-server-ae31d0321715deac7f2f5db3253f75d58deecf4e.tar.gz
nextcloud-server-ae31d0321715deac7f2f5db3253f75d58deecf4e.zip
Merge pull request #41486 from nextcloud/fix/41470/invalid_user_group
Fix invalid users/groups handling in advanced search
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Search/Filter/GroupFilter.php5
-rw-r--r--lib/private/Search/Filter/UserFilter.php5
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/Search/Filter/GroupFilter.php b/lib/private/Search/Filter/GroupFilter.php
index 6b42492824c..f0b34a360ca 100644
--- a/lib/private/Search/Filter/GroupFilter.php
+++ b/lib/private/Search/Filter/GroupFilter.php
@@ -38,10 +38,11 @@ class GroupFilter implements IFilter {
string $value,
IGroupManager $groupManager,
) {
- $this->group = $groupManager->get($value);
- if ($this->group === null) {
+ $group = $groupManager->get($value);
+ if ($group === null) {
throw new InvalidArgumentException('Group '.$value.' not found');
}
+ $this->group = $group;
}
public function get(): IGroup {
diff --git a/lib/private/Search/Filter/UserFilter.php b/lib/private/Search/Filter/UserFilter.php
index 1624b60d1a3..963d5e123ac 100644
--- a/lib/private/Search/Filter/UserFilter.php
+++ b/lib/private/Search/Filter/UserFilter.php
@@ -38,10 +38,11 @@ class UserFilter implements IFilter {
string $value,
IUserManager $userManager,
) {
- $this->user = $userManager->get($value);
- if ($this->user === null) {
+ $user = $userManager->get($value);
+ if ($user === null) {
throw new InvalidArgumentException('User '.$value.' not found');
}
+ $this->user = $user;
}
public function get(): IUser {