Skip to content

Commit eca9d75

Browse files
authored
Fix regex for allowed characters in user ID
was incorrectly banning # symbols solves issues regarding SSO with Microsoft 365 accounts Signed-off-by: kale1d0code <[email protected]>
1 parent 89fcefb commit eca9d75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/private/User/Manager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ public function validateUserId(string $uid, bool $checkDataDirectory = false): v
694694
$l = Server::get(IFactory::class)->get('lib');
695695

696696
// Check the ID for bad characters
697-
// Allowed are: "a-z", "A-Z", "0-9", spaces and "_.@-'"
698-
if (preg_match('/[^a-zA-Z0-9 _.@\-\']/', $uid)) {
697+
// Allowed are: "a-z", "A-Z", "0-9", spaces and "_.@-'#"
698+
if (preg_match(/[^a-zA-Z0-9 _.@\-'#]/’, $uid)) {
699699
throw new \InvalidArgumentException($l->t('Only the following characters are allowed in an Login:'
700700
. ' "a-z", "A-Z", "0-9", spaces and "_.@-\'"'));
701701
}

0 commit comments

Comments
 (0)