mirror of
https://github.com/nextcloud/server.git
synced 2026-05-26 03:04:35 -04:00
Merge pull request #52384 from nextcloud/backport/51994/stable28
[stable28] fix(federation): allows equal signs in federation id
This commit is contained in:
commit
151fa6995f
2 changed files with 8 additions and 1 deletions
|
|
@ -126,7 +126,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)) {
|
||||
return new CloudId($id, $user, $remote, $this->getDisplayNameFromContact($id));
|
||||
|
|
|
|||
|
|
@ -70,6 +70,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