mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
fix(federation): allows equal signs in federation id
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
parent
cb92b5a64a
commit
743924ce4d
2 changed files with 8 additions and 1 deletions
|
|
@ -106,7 +106,10 @@ class CloudIdManager implements ICloudIdManager {
|
|||
$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);
|
||||
|
|
|
|||
|
|
@ -91,6 +91,10 @@ class CloudIdManagerTest extends TestCase {
|
|||
['test@example.com/cloud/', 'test', 'example.com/cloud', 'test@example.com/cloud'],
|
||||
['test@example.com/cloud/index.php', 'test', 'example.com/cloud', 'test@example.com/cloud'],
|
||||
['test@example.com@example.com', 'test@example.com', 'example.com', 'test@example.com@example.com'],
|
||||
|
||||
// Equal signs are not valid on Nextcloud side, but can be used by other federated OCM compatible servers
|
||||
['test==@example.com', 'test==', 'example.com', 'test==@example.com'],
|
||||
['==@example.com', '==', 'example.com', '==@example.com'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue