diff options
author | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2023-11-15 16:34:56 +0100 |
---|---|---|
committer | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2023-11-15 16:34:56 +0100 |
commit | 82c164dabeb7f968dea69532c904e599f8a458cf (patch) | |
tree | 33dc6c0f245331d6e57773b11536e4e752a5b9ea | |
parent | ce6e3a3a01ee33fb010382cb33f527dcb8989544 (diff) | |
download | nextcloud-server-82c164dabeb7f968dea69532c904e599f8a458cf.tar.gz nextcloud-server-82c164dabeb7f968dea69532c904e599f8a458cf.zip |
Change person type separator
`/` isn't allowed in UID, it will avoid conflicts
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
-rw-r--r-- | lib/private/Search/FilterFactory.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/Search/FilterFactory.php b/lib/private/Search/FilterFactory.php index 19afb2c04be..2e96dfb7960 100644 --- a/lib/private/Search/FilterFactory.php +++ b/lib/private/Search/FilterFactory.php @@ -32,6 +32,8 @@ use OCP\IUserManager; use RuntimeException; final class FilterFactory { + private const PERSON_TYPE_SEPARATOR = '/'; + public static function get(string $type, string|array $filter): IFilter { return match ($type) { FilterDefinition::TYPE_BOOL => new Filter\BooleanFilter($filter), @@ -48,7 +50,7 @@ final class FilterFactory { } private static function getPerson(string $person): IFilter { - $parts = explode('_', $person, 2); + $parts = explode(self::PERSON_TYPE_SEPARATOR, $person, 2); return match (count($parts)) { 1 => self::get(FilterDefinition::TYPE_NC_USER, $person), |