Merge pull request #24515 from nextcloud/fix/noid/dav-share-groups-special-chars

fixes sharing to group ids with characters that are being url encoded
This commit is contained in:
Christoph Wurst 2020-12-18 12:01:49 +01:00 committed by GitHub
commit fbf25e164d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 7 deletions

View File

@ -345,9 +345,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
$principals = array_merge($principals, $this->principalBackend->getCircleMembership($principalUriOriginal));
$principals = array_map(function ($principal) {
return urldecode($principal);
}, $principals);
$principals[] = $principalUri;
$fields = array_values($this->propertyMap);

View File

@ -190,9 +190,6 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
$principals = array_merge($principals, $this->principalBackend->getCircleMembership($principalUriOriginal));
$principals = array_map(function ($principal) {
return urldecode($principal);
}, $principals);
$principals[] = $principalUri;
$query = $this->db->getQueryBuilder();

View File

@ -232,7 +232,7 @@ class GroupPrincipalBackend implements BackendInterface {
}
}
$carry[] = self::PRINCIPAL_PREFIX . '/' . $gid;
$carry[] = self::PRINCIPAL_PREFIX . '/' . urlencode($gid);
return $carry;
}, []);
break;

View File

@ -107,6 +107,7 @@ class Backend {
return;
}
$principal[2] = urldecode($principal[2]);
if (($principal[1] === 'users' && !$this->userManager->userExists($principal[2])) ||
($principal[1] === 'groups' && !$this->groupManager->groupExists($principal[2]))) {
// User or group does not exist