Skip to content

Commit 2c0325c

Browse files
committed
fix(federation): allows equal signs in federation id
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent f8391e6 commit 2c0325c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/private/Federation/CloudIdManager.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ public function resolveCloudId(string $cloudId): ICloudId {
106106
$user = substr($id, 0, $lastValidAtPos);
107107
$remote = substr($id, $lastValidAtPos + 1);
108108

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

111114
if (!empty($user) && !empty($remote)) {
112115
$remote = $this->ensureDefaultProtocol($remote);

tests/lib/Federation/CloudIdManagerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public function cloudIdProvider(): array {
9191
['test@example.com/cloud/', 'test', 'example.com/cloud', 'test@example.com/cloud'],
9292
['test@example.com/cloud/index.php', 'test', 'example.com/cloud', 'test@example.com/cloud'],
9393
['test@example.com@example.com', 'test@example.com', 'example.com', 'test@example.com@example.com'],
94+
['test==@example.com', 'test==', 'example.com', 'test==@example.com'],
9495
];
9596
}
9697

0 commit comments

Comments
 (0)