Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/private/Federation/CloudIdManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ public function resolveCloudId(string $cloudId): ICloudId {
$user = substr($id, 0, $lastValidAtPos);
$remote = substr($id, $lastValidAtPos + 1);

$this->userManager->validateUserId($user);
// We accept slightly more chars when working with federationId than with a local userId.
// We remove those eventual chars from the UserId before using
// the IUserManager API to confirm its format.
$this->userManager->validateUserId(str_replace('=', '-', $user));

if (!empty($user) && !empty($remote)) {
$remote = $this->ensureDefaultProtocol($remote);
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/Federation/CloudIdManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public function cloudIdProvider(): array {
['[email protected]/cloud/', 'test', 'example.com/cloud', '[email protected]/cloud'],
['[email protected]/cloud/index.php', 'test', 'example.com/cloud', '[email protected]/cloud'],
['[email protected]@example.com', '[email protected]', 'example.com', '[email protected]@example.com'],

// Equal signs are not valid on Nextcloud side, but can be used by other federated OCM compatible servers
['[email protected]', 'test==', 'example.com', '[email protected]'],
['[email protected]', '==', 'example.com', '[email protected]'],
];
}

Expand Down
Loading